[Python-Dev] Initialization of builtins (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sat Oct 10 21:40:34 CEST 2009
- Previous message: [Python-Dev] Initialization of __builtins__
- Next message: [Python-Dev] Initialization of __builtins__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Vinay Sajip <vinay_sajip yahoo.co.uk> writes:
In the py3k branch, logging has the line unicode = 'unicode' in dir(builtins)
Why do you do this? In py3k, unicode is always enabled but it's called "str" and the name "unicode" doesn't exist.
to determine the existence of Unicode support. The code in trunk, being 1.5.2 compatible, used
hasattr(types, 'UnicodeType')
Why don't you simply write:
unicode_support = True
try:
unicode
except NameError:
unicode_support = False
?
- Previous message: [Python-Dev] Initialization of __builtins__
- Next message: [Python-Dev] Initialization of __builtins__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]