[New-bugs-announce] [issue5348] Documentation of format implies only strings and numbers are acceptable arguments
Mitchell Model
report at bugs.python.org
Mon Feb 23 03:17:04 CET 2009
New submission from Mitchell Model <mlm at acm.org>:
The documentation of format on the builtin functions page should be
changed from "Convert a string or a number" to "Convert a value".
The documentation begins "Convert a string or a number". This is
misleading in that format can be called on any value, since there is an
Object.__format__ and classes can define their own __format__ method.
PEP 3101 is explicit about all of this and the documentation of
__format__ ends by noting that "format(value, format_spec) merely calls
value.__format__(format_spec)". typeobject.c implements
Object.__format__ with a note about PEP 3101.
Given all of that I don't see why format should be explained as taking a
string or a number as its first argument.
----------
assignee: georg.brandl
components: Documentation
messages: 82616
nosy: MLModel, georg.brandl
severity: normal
status: open
title: Documentation of format implies only strings and numbers are acceptable arguments
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5348>
_______________________________________
More information about the New-bugs-announce
mailing list