globals_del.py 474 B

123456789101112131415161718192021222324252627
  1. """
  2. 1
  3. """
  4. def _f(): pass
  5. FunctionType = type(_f)
  6. LambdaType = type(lambda: None)
  7. CodeType = None
  8. MappingProxyType = None
  9. SimpleNamespace = None
  10. def _g():
  11. yield 1
  12. GeneratorType = type(_g())
  13. class _C:
  14. def _m(self): pass
  15. MethodType = type(_C()._m)
  16. BuiltinFunctionType = type(len)
  17. BuiltinMethodType = type([].append)
  18. del _f
  19. # print only the first 8 chars, since we have different str rep to CPython
  20. print(str(FunctionType)[:8])
  21. print(str(BuiltinFunctionType)[:8])