Skip to content

Conversation

@Four-Velocity
Copy link

According to the parsimonious/nodes.pyi NodeVisitor.visit should return Any, while NodeVisitor.parse and NodeVisitor.match should return Node.

According to the code and docstrings of the parsimonious parse and match methods are just a shortcuts for the visit method:

SomeVisitor().parse('some_string') is a shortcut for
SomeVisitor().visit(some_grammar.parse('some_string')).

SomeVisitor().match('some_string') is a shortcut for
SomeVisitor().visit(some_grammar.match('some_string')).

So the return type of the parse and match should be the same as for the visit

@Four-Velocity Four-Velocity marked this pull request as draft January 18, 2023 16:55
@Four-Velocity
Copy link
Author

Ok, perhaps I need some time or help to figure out how to specify it correctly 🙃

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Four-Velocity Four-Velocity marked this pull request as ready for review January 18, 2023 20:58
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Four-Velocity
Copy link
Author

Hey @JelleZijlstra 👋
Looks like it's done

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

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

@JelleZijlstra JelleZijlstra merged commit 8ff3278 into python:main Mar 9, 2023
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