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/2016-October/146768.html below:

[Python-Dev] Default formatting

[Python-Dev] Default formatting [Python-Dev] Default formattingSerhiy Storchaka storchaka at gmail.com
Thu Oct 27 05:51:43 EDT 2016
On 27.10.16 02:44, Eric V. Smith wrote:
> But on the other hand, the existing behavior is well specified and has
> been around since object.__format__ was added. I'm not sure it needs
> changing. What's the harm in leaving it?

More complicated code. And maybe this behavior is less intuitive. It 
contradicts the documentation.

 From the documentation of the format() builtin [1]:

"The default format_spec is an empty string which usually gives the same 
effect as calling str(value)."

 From the description of the format specification mini-language [2]:

"A general convention is that an empty format string ("") produces the 
same result as if you had called str() on the value."

[1] https://docs.python.org/3/library/functions.html#format
[2] https://docs.python.org/3/library/stdtypes.html#str.format

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