A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-March/152379.html below:

[Python-Dev] Symmetry arguments for API expansion

[Python-Dev] Symmetry arguments for API expansion [Python-Dev] Symmetry arguments for API expansionGuido van Rossum guido at python.org
Tue Mar 13 11:23:38 EDT 2018
On Mon, Mar 12, 2018 at 10:01 PM, Tim Peters <tim.peters at gmail.com> wrote:

> At heart, the Fraction() constructor is _all about_ creating integer
> ratios, so is the most natural place to put knowledge of how to do so.
> A protocol for allowing new numeric types to get converted to Fraction
> would be more generally useful than just a weird method only datetime
> uses ;-)
>

Ironically, the various Fraction constructors *calls* as_integer_ratio()
for floats and Decimals. From which follows IMO that the float and Decimal
classes are the right place to encapsulate the knowledge on how to do it.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180313/90969455/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4