From 3e7b1a04a0fe02098ffc03b5c0fc6546a5f7d2d1 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 25 Jun 2001 19:46:25 +0000 Subject: Teach the types module about generators. Thanks to James Althoff on the Iterators list for bringing it up! --- Lib/types.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Lib/types.py') 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) -- cgit v1.2.1