[3.13] gh-132159: Do not shadow user arguments in generated `__new__` by `@warnings.deprecated` (GH-132160) by miss-islington · Pull Request #132163 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Lib/test/test_warnings/__init__.py
2 changes: 1 addition & 1 deletion Lib/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def __call__(self, arg, /):
original_new = arg.__new__

@functools.wraps(original_new)
def __new__(cls, *args, **kwargs):
def __new__(cls, /, *args, **kwargs):
if cls is arg:
warn(msg, category=category, stacklevel=stacklevel + 1)
if original_new is not object.__new__:
Expand Down