classification
Title: Documentation for fractions module needs work
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: jyasskin, mark.dickinson
Priority: normal Keywords: patch

Created on 2008-06-25 11:22 by mark.dickinson, last changed 2008-06-27 17:04 by mark.dickinson. This issue is now closed.

Files
File name Uploaded Description Edit
fractions_doc.patch mark.dickinson, 2008-06-25 16:09 Documentation update for fractions module
fractions_doc2.patch mark.dickinson, 2008-06-27 11:16
Messages (5)
msg68724 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-25 11:22
The documentation for the fractions module needs some rewriting---it 
contains minor inaccuracies, outdated statements (e.g. the regex is 
incomplete), and there are places that could use some clarification (e.g. 
the description of __round__).

I plan to take care of this in the next few days, unless anyone else wants 
to have a look.  I'm making an issue of it so that it doesn't get 
forgotten.
msg68734 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-25 16:09
Here's a proposed new draft of the fractions documentation for 2.6.  
Apart from wording changes, it:

 - removes documentation for __floor__, __ceil__ and __round__, since
   those no longer exist in 2.6

 - describes construction from a decimal string;  e.g. Fraction('1.23')

 - gives the acceptable string inputs using BNF rather than via a regex.

Jeffrey: does this look reasonable?
msg68824 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-27 11:16
Here's an updated doc patch;  it fixes an indentation issue in the 
previous patch, and adds documentation for the exported gcd function.
msg68833 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-06-27 16:34
> [sign] integer '.' [fraction] | [sign] ['.'] fraction

Shouldn't make the second '.' optional or this will match plain
numerators too.

Otherwise, looks good. Thanks for fixing this!
msg68835 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-06-27 17:04
> Shouldn't make the second '.' optional or this will match plain
> numerators too.

Thanks.  Fixed, and committed in r64561 (trunk), and r64562 (py3k).
History
Date User Action Args
2008-06-27 17:04:38mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg68835
2008-06-27 16:34:49jyasskinsetmessages: + msg68833
2008-06-27 11:16:51mark.dickinsonsetfiles: + fractions_doc2.patch
messages: + msg68824
2008-06-25 16:09:42mark.dickinsonsetfiles: + fractions_doc.patch
keywords: + patch
messages: + msg68734
2008-06-25 11:22:22mark.dickinsoncreate