-
-
Notifications
You must be signed in to change notification settings - Fork 26
fix: Resolve pa.scalar overload overlaps
#208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Avoid 18 warnings from `pyright` - very similar to zen-xu#183 - `MonthDayNano` was a bit tricky, but is based on https://github.com/python/typeshed/blob/a045be8ed62492952595661118af22554c7cbca4/stdlib/_typeshed/__init__.pyi#L316-L333 - Had to rewrite manually to avoid overload overlaps on `CollectionValue` - Has all the properties/members returns by `inspect.getmembers` - Signature via `inspect.signature`
|
Can you give an example? |
@zen-xu I'm not sure I understand correctly, so apologies if this is the wrong part. Example 1The example I gave comes from https://github.com/narwhals-dev/narwhals/blob/9d44834321c6cdeecb902f3a41742669a2156cc5/narwhals/_arrow/series.py#L1100 But as I mentioned in (#219 (comment)), this issue can show up anywhere Example in description
Example of flaky false-negativeMentioned in Loading a module for the first time fails to match an overload Editing the file (e.g. adding a space) "fixes" the issue Example 2This was the most minimal repro I could do for the performance issue (ignoring my initial typo 😄) 2025-04-22.10-23-20.-.scalar.mp4SpecsI've not had performance issues from stubs before - but just to verify - I don't think I'm pushing my PC too far here
|
An earlier commit required a fix that modified `pyproject.toml` (076cf54)
pyproject.toml
Outdated
| mypy = ">=1.15" | ||
| ruff = ">=0.11.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Example 2 did not reproduce on my Mac
|
@zen-xu could you try a more recent The version you're using seems to be from 8 months ago - which would be before I started using |
|
Oh for the second example, it is important to have these settings enabled "python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.variableTypes": true,
|
|
I think #233 has resolved this problem |


pyrightchunked_arrayoverlapping overloads #183MonthDayNanowas a bit tricky, but is based on https://github.com/python/typeshed/blob/a045be8ed62492952595661118af22554c7cbca4/stdlib/_typeshed/__init__.pyi#L316-L333CollectionValueinspect.getmembersinspect.signatureExample of flaky false-negative
Mentioned in
typesoverloads #219 (comment)array.pyierrors #209 (comment)Loading a module for the first time fails to match an overload
Editing the file (e.g. adding a space) "fixes" the issue