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/078189.html below:

[Python-Dev] Decimal(unicode)

[Python-Dev] Decimal(unicode) [Python-Dev] Decimal(unicode)Oleg Broytmann phd at phd.pp.ru
Tue Mar 25 14:46:17 CET 2008
Hello. In Python 2.5.1 the code

import decimal

for d in '123', u'123':
    x = decimal.Decimal(d)
    print type(x.to_eng_string())

prints

<type 'str'>
<type 'str'>

   In 2.5.2 it prints

<type 'str'>
<type 'unicode'>

   Why the change? Is it a bug or a feature? Shouldn't .to_eng_string()
always return a str?

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.
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