False positive `unexpected-keyword` with Python 3.15 `frozendict` when called with keyword arguments
Author: edgarrmondragonCreated Sep 21, 2026Updated Sep 21, 2026
Labelstypechecking
Describe the Bug
# fd.py
foo = frozendict() # OK
bar = frozendict({}) # OK
baz = frozendict(x=1) # E: Unexpected keyword argument `x` in function `frozendict.__init__`$ uvx -q --from 'pyrefly==1.4.0.dev1' pyrefly check --python-version 3.15 fd.py
ERROR Unexpected keyword argument `x` in function `frozendict.__init__` [unexpected-keyword]
--> fd.py:4:18
|
4 | baz = frozendict(x=1) # E: Unexpected keyword argument `x` in function `frozendict.__init__`
| ^
INFO 1 error
No `pyrefly.toml` found — using preset `basic`.
Run `pyrefly init` to continue setting up Pyrefly.
Docs: https://pyrefly.org/en/docs/installation/I think all that's needed is updating the bundled typeshed, see:
- https://github.com/microsoft/pyright/issues/11742
- https://github.com/python/typeshed/commit/f76037a1eb3923c67a8bc0e302ee9c016ffb3431
Sandbox Link
N/A, frozendict is Python 3.15+
(Only applicable for extension issues) IDE Information
No response
Source: facebook/pyrefly