[Python-Dev] trunc()
Steve Holden
steve at holdenweb.com
Fri Jan 25 13:47:53 CET 2008
Jeffrey Yasskin wrote:
> On Jan 24, 2008 1:11 PM, Raymond Hettinger <python at rcn.com> wrote:
[...]
>
> One of my goals for trunc() is to replace the from-float use of int(),
> even though we can't remove it for backward-compatibility reasons. PEP
> 3141 says:
>
> "Because the int() conversion implemented by float (and by
> decimal.Decimal) is equivalent to but less explicit than trunc(),
> let's remove it. (Or, if that breaks too much, just add a deprecation
> warning.)"
>
> That needs to be updated and implemented. I think the decision was
> that removing float.__int__() would break too much, so it needs a
> deprecation warning in 3.0.
>
It seems strange to me that a release that has the avowed intention of
producing a "more rational" language by breaking backwards compatibility
should start out with deprecation warnings of this type.
What's next: "This isn't Perl" when someone tries to add a number and a
string?
Surely the place to raise warnings is in 2to3.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-Dev
mailing list