Skip to content

Fix new type error - #489

Merged
AlexWaygood merged 3 commits into
mainfrom
JelleZijlstra-patch-1
May 18, 2024
Merged

Fix new type error#489
AlexWaygood merged 3 commits into
mainfrom
JelleZijlstra-patch-1

Conversation

@JelleZijlstra

Copy link
Copy Markdown
Collaborator

python/typeshed#11880 correctly points out that not all AST nodes have a line and column number.

python/typeshed#11880 correctly points out that not all AST nodes have a line and column number.
Comment thread pyi.py Outdated

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a protocol would be a better fit here? Any node will do as long as it has a lineno and col_offset

@github-actions

This comment has been minimized.

@srittau

srittau commented May 18, 2024

Copy link
Copy Markdown
Member

Maybe a protocol would be a better fit here? Any node will do as long as it has a lineno and col_offset

It might even be worthwhile to add such a protocol to typeshed, considering that this will be a fairly common use case.

@AlexWaygood

AlexWaygood commented May 18, 2024

Copy link
Copy Markdown
Collaborator

It might even be worthwhile to add such a protocol to typeshed

Yeah — or perhaps useful_types, since it can be awkward to use typeshed-only types in runtime code.

But for now I think we could just roll our own

@github-actions

Copy link
Copy Markdown

This change has no effect on typeshed. 🤖🎉

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AlexWaygood
AlexWaygood merged commit f1230fc into main May 18, 2024
@AlexWaygood
AlexWaygood deleted the JelleZijlstra-patch-1 branch May 18, 2024 14:44
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.

3 participants