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
commit70d5aca73860e3965e6617b83f1bc7a5d86dd670 (patch)
tree667cfd0ef14c43aee49148aab96b1ed9bf364a9d /Lib/types.py
parent46759c77731dc422fd5cadf285f6c4e28e175fa1 (diff)
downloadcpython-70d5aca73860e3965e6617b83f1bc7a5d86dd670.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)