Skip to content
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

Fix for PR #1149 #1150

Merged
merged 4 commits into from
May 24, 2022
Merged

Fix for PR #1149 #1150

merged 4 commits into from
May 24, 2022

Conversation

erezsh
Copy link
Member

@erezsh erezsh commented May 24, 2022

No description provided.

template_var = self.test_var(template)
if template_var:
if not isinstance(tree, Tree):
raise TypeError(f"Template variables can only match Tree instances. Not {tree}")
Copy link
Member

Choose a reason for hiding this comment

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

This should be either type(tree) or {tree!r}

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

_TEMPLATE_MARKER = '$'


class TemplateConf:
"""Template Configuration

Allows customization for different uses of Template

parse() must return a Tree instance.
"""

def __init__(self, parse=None):
Copy link
Member

Choose a reason for hiding this comment

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

This could be annotated with Callable[[str], Tree]

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but there's a lot of "could be" to add there. We can do that in a different PR.

Copy link
Member

@MegaIng MegaIng left a comment

Choose a reason for hiding this comment

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

Yeah, fair enough. This should fix all the mypy errors

@erezsh erezsh merged commit 133b737 into master May 24, 2022
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