A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-October/092926.html below:

[Python-Dev] Initialization of __builtins__

[Python-Dev] Initialization of __builtins__ [Python-Dev] Initialization of __builtins__Antoine Pitrou solipsis at pitrou.net
Sat Oct 10 21:40:34 CEST 2009
Vinay Sajip <vinay_sajip <at> 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

?


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4