types: Patch to make loadable in MicroPython.

We don't have too internal, advanced, or obscure types exposed.
asyncio-segfault
Paul Sokolovsky 2014-04-06 19:28:43 +03:00
rodzic 54d9716666
commit a1af6b1e22
1 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -11,9 +11,9 @@ import sys
def _f(): pass def _f(): pass
FunctionType = type(_f) FunctionType = type(_f)
LambdaType = type(lambda: None) # Same as FunctionType LambdaType = type(lambda: None) # Same as FunctionType
CodeType = type(_f.__code__) CodeType = None # TODO: Add better sentinel which can't match anything
MappingProxyType = type(type.__dict__) MappingProxyType = None # TODO: Add better sentinel which can't match anything
SimpleNamespace = type(sys.implementation) SimpleNamespace = None # TODO: Add better sentinel which can't match anything
def _g(): def _g():
yield 1 yield 1
@ -31,14 +31,14 @@ ModuleType = type(sys)
try: try:
raise TypeError raise TypeError
except TypeError: except TypeError:
tb = sys.exc_info()[2] # tb = sys.exc_info()[2]
TracebackType = type(tb) TracebackType = None # TODO: Add better sentinel which can't match anything
FrameType = type(tb.tb_frame) FrameType = None # TODO: Add better sentinel which can't match anything
tb = None; del tb tb = None; del tb
# For Jython, the following two types are identical # For Jython, the following two types are identical
GetSetDescriptorType = type(FunctionType.__code__) GetSetDescriptorType = None # TODO: Add better sentinel which can't match anything
MemberDescriptorType = type(FunctionType.__globals__) MemberDescriptorType = None # TODO: Add better sentinel which can't match anything
del sys, _f, _g, _C, # Not for export del sys, _f, _g, _C, # Not for export