gh-84978: Add float.from_number() and complex.from_number() by serhiy-storchaka · Pull Request #26827 · python/cpython
They are alternate constructors which only accept numbers (including objects with special methods __float__, __complex__ and __index__), but not strings.
serhiy-storchaka
changed the title
bpo-40801: Add float.from_number() and complex.from_number()
gh-84978: Add float.from_number() and complex.from_number()
skirpichev added a commit to skirpichev/cpython that referenced this pull request
Taken from python#26827 Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull request
…thonGH-26827) They are alternate constructors which only accept numbers (including objects with special methods __float__, __complex__ and __index__), but not strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters