Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChainMap.fromkeys is positional-only #13239

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 1 addition & 2 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ _collections_abc.AsyncGenerator.ag_running
asyncio.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them
asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them
builtins.dict.get
collections\.ChainMap\.fromkeys # https://github.com/python/mypy/issues/17023
contextlib._GeneratorContextManagerBase.__init__ # skipped in the stubs in favor of its child classes
ctypes.CDLL._FuncPtr # None at class level but initialized in __init__ to this value
ctypes.memmove # CFunctionType
Expand Down Expand Up @@ -39,7 +38,7 @@ tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
tkinter.simpledialog.TkVersion
tkinter.Misc.after # we intentionally don't allow everything that "works" at runtime
tkinter.Text.count # stubtest somehow thinks that index1 parameter has a default value, but it doesn't in any of the overloads
tkinter.Text.count # https://github.com/python/mypy/issues/17023 mixed pos-or-kw and pos-only params confuse stubtest
unittest.mock.patch # It's a complicated overload and I haven't been able to figure out why stubtest doesn't like it
weakref.WeakKeyDictionary.update
weakref.WeakValueDictionary.update
Expand Down
2 changes: 1 addition & 1 deletion stdlib/collections/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ class ChainMap(MutableMapping[_KT, _VT]):
# so the signature should be kept in line with `dict.fromkeys`.
@classmethod
@overload
def fromkeys(cls, iterable: Iterable[_T]) -> ChainMap[_T, Any | None]: ...
def fromkeys(cls, iterable: Iterable[_T], /) -> ChainMap[_T, Any | None]: ...
@classmethod
@overload
# Special-case None: the user probably wants to add non-None values later.
Expand Down
Loading