Skip to content

False positive unexpected-keyword with Python 3.15 frozendict when called with keyword arguments #4994

Description

@edgarrmondragon

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:

Sandbox Link

N/A, frozendict is Python 3.15+

(Only applicable for extension issues) IDE Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions