Skip to content

Shapely: Add Any typing to kwargs arguments#15858

Closed
jack-volantautonomy wants to merge 2 commits into
python:mainfrom
jack-volantautonomy:shapely-kwargs-typing
Closed

Shapely: Add Any typing to kwargs arguments#15858
jack-volantautonomy wants to merge 2 commits into
python:mainfrom
jack-volantautonomy:shapely-kwargs-typing

Conversation

@jack-volantautonomy
Copy link
Copy Markdown
Contributor

The aim of this PR is to add a form of typing to the kwargs arguments as usage of these methods results in lots of reportUnknownMemberType checks being flagged in codebases with check enabled. Any typing doesn't provide any extra type safety, but is in no way a downgrade from having no typing at all.

In future it would be nice to type these better or if numpy.typing includes a typing for this kwargs argument for ufunc.kwargs, but I cannot see anything at current. At this moment, this seems like the most logical and simple fix for this exact issue.

@srittau
Copy link
Copy Markdown
Collaborator

srittau commented Jun 2, 2026

I'm sorry, but it's typeshed policy not to use Any where a proper type could be substituted. Just using Any to suppress reportUnknownMemberType is also not the right approach, as that's effectively a lie. Either suppress the calls using # pyright: ignore or disable the check. (Or – ideally – submit a PR that uses proper keyword args for these functions/methods).

@srittau srittau closed this Jun 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants