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/2008-March/077958.html below:

[Python-Dev] The Breaking of distutils and PyPI for Python 3000?

[Python-Dev] The Breaking of distutils and PyPI for Python 3000? [Python-Dev] The Breaking of distutils and PyPI for Python 3000?Bob Kline bkline at rksystems.com
Thu Mar 20 22:46:08 CET 2008
Martin v. Löwis wrote:
>
>> Not if it includes code that looks like this:
>>
>>    if type(response) in (str, unicode): .....
>>
>> and it's really true that "[a]nything having to do with the 
>> str->bytes/unicode->str move is so far off-limits" to the upgrade tool.
>
> Depends on what the purpose of the test is. If it tests for
> "is response text", then 2to3 will work just fine on it, converting
> it to
>
> if type(response) in (str, str):

Then I'm taking him too literally, when he writes that the tool won't 
touch *anything* that has to do with the str->bytes/unicode->str move (I 
assumed that meant it wouldn't touch "unicode" in the snippet I gave 
above), right?

Will the tool also make the following work correctly?

    if type(s) is str: s = unicode(s, 'utf-8')

-- 
Bob Kline
http://www.rksystems.com
mailto:bkline at rksystems.com

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