cpython/Misc/NEWS.d/next/Library/2022-12-14-15-53-38.gh-issue-100242.Ny7VUO.rst
CF Bolz-Tereick 5a0209fc23
GH-100242: bring functools.py partial implementation more in line with C code (GH-100244)
in partial.__new__, before checking for the existence of the attribute
'func', first check whether the argument is an instance of partial.
2024-04-17 15:34:46 +02:00

5 lines
349 B
ReStructuredText

Bring pure Python implementation ``functools.partial.__new__`` more in line
with the C-implementation by not just always checking for the presence of
the attribute ``'func'`` on the first argument of ``partial``. Instead, both
the Python version and the C version perform an ``isinstance(func, partial)``
check on the first argument of ``partial``.