A Revised Rational Proposal
steven.bethard at gmail.com
Sun Dec 26 18:55:34 CET 2004
Dan Bishop wrote:
> Mike Meyer wrote:
> I'll be the first to volunteer an implementation.
Very cool. Thanks for the quick work!
For stdlib acceptance, I'd suggest a few cosmetic changes:
Use PEP 257 docstring conventions, e.g. triple-quoted strings.
Use PEP 8 naming conventions, e.g. name functions from_exact_float,
The decimal and math modules should probably be imported as _decimal and
_math. This will keep them from showing up in the module namespace in
editors like PythonWin.
I would be inclined to name the instance variables _n and _d instead of
the double-underscore versions. There was a thread a few months back
about avoiding overuse of __x name-mangling, but I can't find it. It
also might be nice for subclasses of Rational to be able to easily
access _n and _d.
Thanks again for your work!
More information about the Python-list