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/2010-February/097916.html below:

[Python-Dev] 3.1 and 2.7 break format() when used with complex (sometimes)

[Python-Dev] 3.1 and 2.7 break format() when used with complex (sometimes) [Python-Dev] 3.1 and 2.7 break format() when used with complex (sometimes)Eric Smith eric at trueblade.com
Tue Feb 23 19:36:30 CET 2010
> The root cause of this problem is object.__format__, which is basically:
> 
> def __format__(self, fmt):
>   return str(self).__format__(fmt)
> 
> So here we're changing the type of the object (to str) but still keeping 
> the same format string. That doesn't make any sense: the format string 
> is type specific. I think the correct thing to do here is to make it an 
> error if fmt is non-empty. In 2.7 and 3.2 I can make this a 
> PendingDeprecationWarning, then in 3.3 a DeprecationWarning, and finally 
> make it an error in 3.4.

I have this implemented in issue 7994 with a PendingDeprecationWarning. 
Unless someone objects I'm going to document it and apply the patch.

Eric.

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