commit | 3e7b1a04a0fe02098ffc03b5c0fc6546a5f7d2d1 | [log] [tgz] |
---|---|---|
author | Tim Peters <tim.peters@gmail.com> | Mon Jun 25 19:46:25 2001 +0000 |
committer | Tim Peters <tim.peters@gmail.com> | Mon Jun 25 19:46:25 2001 +0000 |
tree | 1b79b6897c94e6914beb1f86e59c40a2ec9a056d | |
parent | ae1f65ff825f72f3972e503036966e206f5b39fa [diff] [blame] |
Teach the types module about generators. Thanks to James Althoff on the Iterators list for bringing it up!
diff --git a/Lib/types.py b/Lib/types.py index a71a4db..85962ba 100644 --- a/Lib/types.py +++ b/Lib/types.py
@@ -32,6 +32,11 @@ except: pass +def g(): + yield 1 +GeneratorType = type(g()) +del g + class _C: def _m(self): pass ClassType = type(_C)