[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2020-01-21 Thread Dong-hee Na
Dong-hee Na added the comment: rm-finite.patch was applied by bpo-39415. > Once that's merged, let's close this issue as rejected. I close this issue to a rejected state as discussed above. Thank you to all who participated in this discussion. -- nosy: +corona10 resolution: ->

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-02-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-02-02 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Martin, I reviewed the patch (rm-finite.patch) and ran the tests. The patch no longer applies cleanly to the default branch, but otherwise looks good. Assigning this back to you as per Raymond's suggestion. Thanks :) -- assignee: Mariatta ->

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Mariatta, please review the rm-finite patch. We're already agreed that the removal makes sense. What you're checking for is whether patch is complete (that there aren't any dangling references to the removed code and that it doesn't remove too much).

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-30 Thread Mark Dickinson
Mark Dickinson added the comment: rm-finite.patch LGTM. Once that's merged, let's close this issue as rejected. If decimal is ever added as a first-class type (literal support, fixed-width decimal128 or decimal64, etc.), we may want to reconsider, but that day is probably a long way off.

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Martin Panter
Martin Panter added the comment: While I don’t have much opinion either way, here is a patch to remove the existing dead code should that be the eventual outcome. If the default implementations in the base class deferred to math.isfinite() etc, that may help with compatibility. --

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. This expands the API too much. Not just the float API, but the API of all numeric classes, including third-party classes. And since the existence of additional method in third-party classes (e.g. NumPy classes) can't be guarantied,

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would like to caution against expansion of core APIs in cases where we already have a way to do it. In almost every corner, Python's APIs are growing, resulting in the language becoming massive, where very few people on the planet can claim to know what

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Mark Dickinson
Mark Dickinson added the comment: @Martin: the dead code should definitely be removed from floatobject.c and longobject.c. (Though that's kinda independent of this issue.) -- ___ Python tracker

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Martin Panter
Martin Panter added the comment: Of course, somehow I missed that -- ___ Python tracker ___ ___

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sun, Jan 29, 2017 at 08:23:05AM +, Martin Panter wrote: > Why do you name the methods is_finite() etc with underscores, when the > existing methods math.isfinite() etc do not have underscores? Seems it > would add unnecessary confusion. The idea is to

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-29 Thread Martin Panter
Martin Panter added the comment: FWIW, here is an attempt to add Argument Clinic to the Objects/floatobject.c and Objects/longobject.c implementations: https://bugs.python.org/file33943/issue20185_conglomerate_v4.diff https://bugs.python.org/file33989/clinic_longobject_v3.patch If the methods

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2014-10-14 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: -skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18842 ___ ___ Python-bugs-list

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-11-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Should we add these methods to other concrete Number subclasses (as Fraction and complex)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18842 ___

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-11-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Nov 16, 2013 at 04:33:36PM +, Serhiy Storchaka wrote: Should we add these methods to other concrete Number subclasses (as Fraction and complex)? Seems like a good idea to me. Is it worth making them part of the Number ABC, or is that too much

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-10-13 Thread Mark Dickinson
Mark Dickinson added the comment: +1 from me. You want `float.is_infinite` rather than `float.is_infinity`. `is_signed` is another one that may be worth considering. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18842

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-10-13 Thread Christian Heimes
Christian Heimes added the comment: The code is already there so the patch is really small. http://hg.python.org/cpython/annotate/5bc7b20dc04a/Objects/floatobject.c#l1046 I love my time machine. *g* -- keywords: +patch nosy: +christian.heimes Added file:

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-10-13 Thread Christian Heimes
Christian Heimes added the comment: Here is a longer patch that also adds the methods to int and numbers.Real. It comes with tests and doc updates, too. -- stage: - patch review Added file: http://bugs.python.org/file32090/issue18842.patch ___

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-10-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fraction? complex? Complex? Integral? Number? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18842 ___

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-10-13 Thread Christian Heimes
Christian Heimes added the comment: Pardon? The methods could be added to complex, too. cmath implements the methods as: is_finite: Py_IS_FINITE(z.real) Py_IS_FINITE(z.imag) is_infinite: Py_IS_INFINITY(z.real) || Py_IS_INFINITY(z.imag) is_nan: Py_IS_NAN(z.real) ||

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-08-26 Thread Steven D'Aprano
New submission from Steven D'Aprano: On issue 15544 Mark Dickinson suggested adding methods to float to match methods on Decimal, giving type-agnostic ways of testing real numbers that don't rely on converting to float. I don't see any sign that Mark raised a feature request, so I'm taking

[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2013-08-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +facundobatista, mark.dickinson, rhettinger, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18842 ___