This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients docs@python, skip.montanaro
Date 2015-06-09.13:38:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1433857085.94.0.53514781812.issue24417@psf.upfronthosting.co.za>
In-reply-to
Content
I am only now just prying my fingers off printf-style string
formatting. The new syntax always seemed Perl-like to me, so I ignored
it. Finally, yesterday, I got some cheat sheet pointers from
comp.lang.python and dove in.

I hit a minor roadblock when I couldn't find any type-specific
documentation for the various __format__ methods. In the documentation
on the format() builtin
(https://docs.python.org/3.5/library/functions.html#format) I read,
"The interpretation of format_spec will depend on the type of the
value argument..." which led me to believe I would find something
about (for example) float.__format__ in the section on floats
(https://docs.python.org/3.5/library/stdtypes.html#typesnumeric).

I realize now that the documentation for many formats is in the string
documentation
(https://docs.python.org/3.5/library/string.html#formatspec), but I
think it would still be useful to have at least stubs in the
documentation for the __format__ method of the various builtin types,
even if all those stubs to is refer the reader to the string
documentation.

I started to work on a patch, but I quickly got myself confused about
where to describe <sometype>.__format__. Perhaps it's time that
stdtypes.rst is broken into multiple files, with the structure of the
documentation for the various builtin types made more uniform. For
instance, int and float have sections describing methods, while list,
tuple, set, and dict don't.
History
Date User Action Args
2015-06-09 13:38:06skip.montanarosetrecipients: + skip.montanaro, docs@python
2015-06-09 13:38:05skip.montanarosetmessageid: <1433857085.94.0.53514781812.issue24417@psf.upfronthosting.co.za>
2015-06-09 13:38:05skip.montanarolinkissue24417 messages
2015-06-09 13:38:05skip.montanarocreate