Skip to content

Conversation

@JelleZijlstra
Copy link
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.
Copy link
Collaborator

@AlexWaygood AlexWaygood left a comment

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
Copy link
Member

srittau commented May 18, 2024

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
Copy link
Collaborator

AlexWaygood commented May 18, 2024

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

This change has no effect on typeshed. 🤖🎉

Copy link
Collaborator

@AlexWaygood AlexWaygood left a comment

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.

4 participants