This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bluetech
Recipients bluetech
Date 2019-10-29.10:18:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572344297.94.0.916739375163.issue38629@roundup.psfhosted.org>
In-reply-to
Content
The numbers.Real ABC requires the __ceil__ and __floor__ methods (https://github.com/python/cpython/blob/v3.8.0/Lib/numbers.py#L178-L186), however, the float type does not have them.

In regular Python, this is not a problem, because math.ceil() and math.floor() special-case float and work on it directly, and numbers.Real is implemented on float by explicitly registering it (so it's not checked that all required methods are implemented).

Where it becomes a (minor) problem is in typeshed, where the type checker *does* check that all abstract methods are implemented. So, because float is missing these two, typeshed cannot have float implement numbers.Real.

Refs: https://github.com/python/typeshed/issues/3195
History
Date User Action Args
2019-10-29 10:18:18bluetechsetrecipients: + bluetech
2019-10-29 10:18:17bluetechsetmessageid: <1572344297.94.0.916739375163.issue38629@roundup.psfhosted.org>
2019-10-29 10:18:17bluetechlinkissue38629 messages
2019-10-29 10:18:17bluetechcreate