aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorSergey B Kirpichev <skirpichev@gmail.com>2024-01-15 18:04:17 +0300
committerGitHub <noreply@github.com>2024-01-15 16:04:17 +0100
commit0f2fa6150baf111a6c69d5d491c95c3c2ee60eaf (patch)
treee60136c4ac8da4e44cd3bdf4a702372be34a96d1 /Python/symtable.c
parentac10947ba79a15bfdaa3ca92c6864214648ab364 (diff)
downloadcpython-0f2fa6150baf111a6c69d5d491c95c3c2ee60eaf.tar.gz
cpython-0f2fa6150baf111a6c69d5d491c95c3c2ee60eaf.zip
gh-109598: make PyComplex_RealAsDouble/ImagAsDouble use __complex__ (GH-109647)
`PyComplex_RealAsDouble()`/`PyComplex_ImagAsDouble` now try to convert an object to a `complex` instance using its `__complex__()` method before falling back to the ``__float__()`` method. PyComplex_ImagAsDouble() also will not silently return 0.0 for non-complex types anymore. Instead we try to call PyFloat_AsDouble() and return 0.0 only if this call is successful.
Diffstat (limited to 'Python/symtable.c')
0 files changed, 0 insertions, 0 deletions