refactor(typing): use closed=True in some TypedDicts - #3800
Conversation
|
@dangotbanned any objections? |
I did figure out a workaround, that still let's you use them at runtime 😅 Show hack
narwhals/src/narwhals/_plan/altair/api/typing.py Lines 225 to 255 in 0a614b4 Was basically the only way to get narwhals/src/narwhals/_plan/altair/api/encode.py Lines 64 to 81 in 0a614b4 I'm not saying we need this for older
So the situation with that one is if we add (https://mkdocstrings.github.io/griffe/extensions/built-in/unpack-typeddict/) I was thinking that might be useful, since we haven't exposed the 348949020 Griffe doesn't discern |
|
Another option could be defining all of them in a
|
closed=True in some TypeDict casesclosed=True in some TypedDicts
|
we're not using https://mkdocstrings.github.io/griffe/extensions/built-in/unpack-typeddict/ , is it to move forwards with this and then, if/when someone adds that, we revisit? |


closes #3661
this becomes a bit easier to review if you hide whitespace changes: https://github.com/narwhals-dev/narwhals/pull/3800/changes?w=1
i've unpinned mypy/pyrefly from
pyproject.toml, as the version used in CI is taken from the lock file anyway, and like this dependabot updates will take care of those updates. note that we need a mypy version more recent than 2.1.0 for this PR to workDescription
What type of PR is this? (check all applicable)
Related issues
AI assistance
Checklist
Code follows style guide (ruff)
Tests added
Documented the changes
If this is your first PR to narwhals, attach a screenshot of
pytestpassing locally (not CI):