#4994·pyrefly

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

python
# fd.py
foo = frozendict()     # OK
bar = frozendict({})   # OK
baz = frozendict(x=1)  # E: Unexpected keyword argument `x` in function `frozendict.__init__`
bash
$ 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:

Sandbox Link

N/A, frozendict is Python 3.15+

(Only applicable for extension issues) IDE Information

No response