You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deprecate passing some conflicting arguments by keyword #80673
As Steve mentioned in the discussion about PEP-570 [1], some changes of parameters to positional-only are breaking (although there is no breaks in the stdlib code). Before making parameters positional-only we should add a deprecation warning for passing them as keyword arguments. Similarly to the code used in the UserDict constructor (see bpo-22609).
The following PR adds deprecation warnings for other parameters which should be positional-only. It also fixes bugs about nonavailability to pass special keyword names like "self" or "func". Just one example:
>>> import functools
>>> deff(self, func): pass
...
>>> functools.partialmethod(f, func=chr)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() got multiple values for argument 'func'
New changeset a37f356 by Serhiy Storchaka in branch '3.7':
[3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645) a37f356
Activity
serhiy-storchaka commentedon Mar 31, 2019
As Steve mentioned in the discussion about PEP-570 [1], some changes of parameters to positional-only are breaking (although there is no breaks in the stdlib code). Before making parameters positional-only we should add a deprecation warning for passing them as keyword arguments. Similarly to the code used in the UserDict constructor (see bpo-22609).
The following PR adds deprecation warnings for other parameters which should be positional-only. It also fixes bugs about nonavailability to pass special keyword names like "self" or "func". Just one example:
[1] https://discuss.python.org/t/pep-570-python-positional-only-parameters/1078/53
serhiy-storchaka commentedon Apr 1, 2019
New changeset 42a139e by Serhiy Storchaka in branch 'master':
bpo-36492: Deprecate passing some arguments as keyword arguments. (GH-12637)
42a139e
serhiy-storchaka commentedon Apr 1, 2019
New changeset a37f356 by Serhiy Storchaka in branch '3.7':
[3.7] bpo-36492: Fix passing special keyword arguments to some functions. (GH-12637) (GH-12645)
a37f356
serhiy-storchaka commentedon Apr 1, 2019
Fixes (but not deprecations) were backported to 3.7.