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/2008-January/076481.html below:

[Python-Dev] trunc()

[Python-Dev] trunc() [Python-Dev] trunc()Paul Moore p.f.moore at gmail.com
Fri Jan 25 14:53:15 CET 2008
On 24/01/2008, Jeffrey Yasskin <jyasskin at gmail.com> wrote:
> int has to be a builtin because it's a fundamental type. trunc()
> followed round() into the builtins. I have no opinion on whether ceil
> and floor should move there; it probably depends on how often they're
> used.

Suggestion:

- int() has to stay in builtins for obvious reasons.
- put *all* of trunc, ceil, floor, round into math.
- make int(float) an error

The only fly in the ointment is that 2to3 can't handle the semantic
issues around converting int(n) to math.trunc(n) because it can't
detect the type of n. So why not make int(float) warn in -3 mode on
2.6, and then let 2to3 do the conversion (on the basis that 2to3
should only be run on code that is -3 warning free)?

Did I miss a requirement here?

Paul.
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