summaryrefslogtreecommitdiff
path: root/Lib/types.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-06-25 19:46:25 +0000
committerTim Peters <tim.peters@gmail.com>2001-06-25 19:46:25 +0000
commit3e7b1a04a0fe02098ffc03b5c0fc6546a5f7d2d1 (patch)
tree1b79b6897c94e6914beb1f86e59c40a2ec9a056d /Lib/types.py
parentae1f65ff825f72f3972e503036966e206f5b39fa (diff)
downloadcpython-git-3e7b1a04a0fe02098ffc03b5c0fc6546a5f7d2d1.tar.gz
Teach the types module about generators. Thanks to James Althoff on the
Iterators list for bringing it up!
Diffstat (limited to 'Lib/types.py')
-rw-r--r--Lib/types.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/types.py b/Lib/types.py
index a71a4db4e9..85962bada4 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -32,6 +32,11 @@ try:
except:
pass
+def g():
+ yield 1
+GeneratorType = type(g())
+del g
+
class _C:
def _m(self): pass
ClassType = type(_C)