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.

classification
Title: Py_BuildValue format f incorrect description.
Type: Stage:
Components: Documentation Versions: Python 2.7, Python 2.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: docs@python Nosy List: amaury.forgeotdarc, docs@python, felixantoinefortin
Priority: normal Keywords:

Created on 2011-10-06 18:35 by felixantoinefortin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg145031 - (view) Author: Félix-Antoine Fortin (felixantoinefortin) Date: 2011-10-06 18:35
Python/C API Reference Manual, section Utilities, Parsing arguments and building values, function Py_BuildValue.

The description for the format unit "f" is incorrect. It reads "Same as d.", as it should be "Convert a C float to a Python floating point number." since "f" is not the same as "d" when converting double to Python float. 

This was corrected in the documentation of Python 3, from which the proposed description comes.
msg145051 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-10-06 23:12
I've checked in the code: 'f' and 'd' are really the same (Python/modsupport.c).

And in http://en.wikipedia.org/wiki/Stdarg.h, you can read: """A float will automatically be promoted to a double."""
msg145082 - (view) Author: Félix-Antoine Fortin (felixantoinefortin) Date: 2011-10-07 14:57
I stand corrected.
History
Date User Action Args
2022-04-11 14:57:22adminsetgithub: 57327
2011-10-07 14:57:19felixantoinefortinsetstatus: open -> closed
resolution: rejected
messages: + msg145082
2011-10-06 23:12:34amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg145051
2011-10-06 18:35:24felixantoinefortincreate