summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-08 22:07:05 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-08 22:07:05 (GMT)
commit7adc776ea6ab808a4bf8fbf2740bb3bb9a7928a4 (patch)
treec9ba8bbc4fd541cd5761c5de0e92d782b3e3ddf0 /Lib
parent24f3c5c646d26350e4de6a878fed3e6db1e4ff9a (diff)
downloadcpython-7adc776ea6ab808a4bf8fbf2740bb3bb9a7928a4.zip
cpython-7adc776ea6ab808a4bf8fbf2740bb3bb9a7928a4.tar.gz
cpython-7adc776ea6ab808a4bf8fbf2740bb3bb9a7928a4.tar.bz2
Issue 2408: remove the _types module
It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType), when they can easily be obtained with python code. These expressions even work with Jython. I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 ) at least this change makes it simpler.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/types.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/types.py b/Lib/types.py
index 6c8c2b2..ea316fa 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -86,16 +86,8 @@ EllipsisType = type(Ellipsis)
DictProxyType = type(TypeType.__dict__)
NotImplementedType = type(NotImplemented)
-# Extension types defined in a C helper module. XXX There may be no
-# equivalent in implementations other than CPython, so it seems better to
-# leave them undefined then to set them to e.g. None.
-try:
- import _types
-except ImportError:
- pass
-else:
- GetSetDescriptorType = type(_types.Helper.getter)
- MemberDescriptorType = type(_types.Helper.member)
- del _types
+# For Jython, the following two types are identical
+GetSetDescriptorType = type(FunctionType.func_code)
+MemberDescriptorType = type(FunctionType.func_globals)
del sys, _f, _g, _C, _x # Not for export