]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Lib/types.py
AppPkg/Applications/Python/Python-2.7.10: Initial Checkin part 4/5.
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Lib / types.py
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Lib/types.py b/AppPkg/Applications/Python/Python-2.7.10/Lib/types.py
new file mode 100644 (file)
index 0000000..f1f18c7
--- /dev/null
@@ -0,0 +1,86 @@
+"""Define names for all type symbols known in the standard interpreter.\r
+\r
+Types that are part of optional modules (e.g. array) are not listed.\r
+"""\r
+import sys\r
+\r
+# Iterators in Python aren't a matter of type but of protocol.  A large\r
+# and changing number of builtin types implement *some* flavor of\r
+# iterator.  Don't check the type!  Use hasattr to check for both\r
+# "__iter__" and "next" attributes instead.\r
+\r
+NoneType = type(None)\r
+TypeType = type\r
+ObjectType = object\r
+\r
+IntType = int\r
+LongType = long\r
+FloatType = float\r
+BooleanType = bool\r
+try:\r
+    ComplexType = complex\r
+except NameError:\r
+    pass\r
+\r
+StringType = str\r
+\r
+# StringTypes is already outdated.  Instead of writing "type(x) in\r
+# types.StringTypes", you should use "isinstance(x, basestring)".  But\r
+# we keep around for compatibility with Python 2.2.\r
+try:\r
+    UnicodeType = unicode\r
+    StringTypes = (StringType, UnicodeType)\r
+except NameError:\r
+    StringTypes = (StringType,)\r
+\r
+BufferType = buffer\r
+\r
+TupleType = tuple\r
+ListType = list\r
+DictType = DictionaryType = dict\r
+\r
+def _f(): pass\r
+FunctionType = type(_f)\r
+LambdaType = type(lambda: None)         # Same as FunctionType\r
+CodeType = type(_f.func_code)\r
+\r
+def _g():\r
+    yield 1\r
+GeneratorType = type(_g())\r
+\r
+class _C:\r
+    def _m(self): pass\r
+ClassType = type(_C)\r
+UnboundMethodType = type(_C._m)         # Same as MethodType\r
+_x = _C()\r
+InstanceType = type(_x)\r
+MethodType = type(_x._m)\r
+\r
+BuiltinFunctionType = type(len)\r
+BuiltinMethodType = type([].append)     # Same as BuiltinFunctionType\r
+\r
+ModuleType = type(sys)\r
+FileType = file\r
+XRangeType = xrange\r
+\r
+try:\r
+    raise TypeError\r
+except TypeError:\r
+    tb = sys.exc_info()[2]\r
+    TracebackType = type(tb)\r
+    FrameType = type(tb.tb_frame)\r
+    del tb\r
+\r
+SliceType = slice\r
+EllipsisType = type(Ellipsis)\r
+\r
+DictProxyType = type(TypeType.__dict__)\r
+NotImplementedType = type(NotImplemented)\r
+\r
+# For Jython, the following two types are identical\r
+GetSetDescriptorType = type(FunctionType.func_code)\r
+MemberDescriptorType = type(FunctionType.func_globals)\r
+\r
+del sys, _f, _g, _C, _x                           # Not for export\r
+\r
+__all__ = list(n for n in globals() if n[:1] != '_')\r