Skip to content

fix Pyrefly rejects duck-typed Mapping when unpacking in dict #4813 - #4815

Open
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:4813
Open

fix Pyrefly rejects duck-typed Mapping when unpacking in dict #4813#4815
asukaminato0721 wants to merge 1 commit into
facebook:mainfrom
asukaminato0721:4813

Conversation

@asukaminato0721

Copy link
Copy Markdown
Collaborator

Summary

Fixes #4813

dictionary unpacking now accepts compatible keys() and __getitem__() methods without requiring Mapping inheritance.

Test Plan

add test

@meta-cla meta-cla Bot added the cla signed label Sep 4, 2026
@github-actions github-actions Bot added the size/m label Sep 4, 2026
@meta-codesync

meta-codesync Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D118851422. (Because this pull request was imported automatically, there will not be any future comments.)

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Diff from mypy_primer, showing the effect of this PR on open source code:

============================================================
SUMMARY
============================================================
Total: +0 new errors, -5 fixed errors
By preset: +0/-5 (default), +0/-5 (strict)

Projects with changes (2):
  cki-lib: +0 -1
  ibis: +0 -4
============================================================

FULL DIFF DETAILS
------------------------------------------------------------

cki-lib (https://gitlab.com/cki-project/cki-lib)
- ERROR cki_lib/inttests/remote_responses.py:241:80-92: Expected a mapping, got Message [invalid-argument]

ibis (https://github.com/ibis-project/ibis)
- ERROR ibis/common/collections.py:263:20-24: Expected a mapping, got Self@MapSet [invalid-argument]
- ERROR ibis/common/collections.py:272:20-24: Expected a mapping, got Self@MapSet [invalid-argument]
- ERROR ibis/common/collections.py:272:28-33: Expected a mapping, got Self@MapSet [invalid-argument]
- ERROR ibis/expr/types/relations.py:934:32-38: Expected a mapping, got Schema [invalid-argument]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyrefly rejects duck-typed Mapping when unpacking in dict

2 participants