kopia lustrzana https://github.com/micropython/micropython-lib
types: Patch to make loadable in MicroPython.
We don't have too internal, advanced, or obscure types exposed.asyncio-segfault
rodzic
54d9716666
commit
a1af6b1e22
|
@ -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
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue