]> granicus.if.org Git - python/commitdiff
better way to define ComplexType
authorGuido van Rossum <guido@python.org>
Tue, 13 Feb 1996 00:04:31 +0000 (00:04 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 13 Feb 1996 00:04:31 +0000 (00:04 +0000)
Lib/types.py

index 0d2508113950fdc1d54e3bfb94e39aa3c04ed5d4..b6841735ce74c3523877dfab6e29603139c2cb32 100644 (file)
@@ -9,10 +9,10 @@ TypeType = type(NoneType)
 IntType = type(0)
 LongType = type(0L)
 FloatType = type(0.0)
-import __builtin__
-if vars(__builtin__).has_key('complex'):
+try:
        ComplexType = type(complex(0,1))
-del __builtin__
+except NameError:
+       pass
 
 StringType = type('')