classification
Title: Improve documentation for 'float' built-in.
Type: Stage:
Components: Documentation Versions: Python 3.2
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: docs@python, eric.smith, ezio.melotti, mark.dickinson
Priority: normal Keywords: patch

Created on 2010-11-21 12:25 by mark.dickinson, last changed 2010-11-21 21:10 by mark.dickinson. This issue is now closed.

Files
File name Uploaded Description Edit
float_builtin_doc.patch mark.dickinson, 2010-11-21 12:29
float_builtin_doc_v2.patch mark.dickinson, 2010-11-21 13:29
Messages (8)
msg121910 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-11-21 12:25
The docs for 'float' are outdated, and also not entirely written in English. :-)

Here's a patch.
msg121911 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-11-21 12:29
Grr.  Some unintended cut-and-paste duplication there.
msg121915 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2010-11-21 12:44
This is clearly an improvement. Do we want mention __float__?
msg121916 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-11-21 12:47
Ah yes;  good point about __float__. I'll revise.

Ezio Melotti also suggested (on #python-dev) that it would be useful to have some examples here.
msg121917 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-11-21 12:48
I would prefer to keep the doc for float() simple, including what it accepts (numbers and strings) and a few examples like ``'1.2'``, ``'.5'``, ``' +3 '``, ``'inf'``, ``'NaN'``.
Even if the other information is still valuable, I'm not sure this is the best place where to include it, and I think it might be confusing for unexperienced users.
msg121919 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-11-21 12:50
Ezio:  can you suggest a better place for a specification of what float accepts?  I think it's necessary (especially for people working on alternative implementations) to have the information *somewhere*.
msg121923 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-11-21 13:29
Updated patch:

 - add some examples
 - mention __float__
 - mention that large numeric arguments can result in an OverflowError
msg121993 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-11-21 21:10
r86648.
History
Date User Action Args
2010-11-21 21:10:58mark.dickinsonsetstatus: open -> closed

messages: + msg121993
2010-11-21 21:00:14rhettingersetassignee: docs@python -> mark.dickinson
resolution: accepted
2010-11-21 13:29:35mark.dickinsonsetfiles: + float_builtin_doc_v2.patch

messages: + msg121923
2010-11-21 12:50:21mark.dickinsonsetmessages: + msg121919
2010-11-21 12:48:22ezio.melottisetmessages: + msg121917
2010-11-21 12:47:55mark.dickinsonsetnosy: + ezio.melotti
messages: + msg121916
2010-11-21 12:44:28eric.smithsetnosy: + eric.smith
messages: + msg121915
2010-11-21 12:29:52mark.dickinsonsetfiles: - float_builtin_doc.patch
2010-11-21 12:29:45mark.dickinsonsetfiles: + float_builtin_doc.patch

messages: + msg121911
2010-11-21 12:25:43mark.dickinsoncreate