Skip to content

Python: Add Str class #9852

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

Merged
merged 2 commits into from
Aug 22, 2022
Merged

Python: Add Str class #9852

merged 2 commits into from
Aug 22, 2022

Conversation

tausbn
Copy link
Contributor

@tausbn tausbn commented Jul 19, 2022

This makes the AST viewer (which annotates string constant nodes as Str, and not StrConst) a bit more consistent.

Fixes #9833.

It might be even better to instead flip the inheritance and make Str the lowest class in the hierarchy. That way, it would have access to all of the methods on StrConst (and indeed, we might consider just deprecating that class).


This is a very minor change, so I don't think a change note is required.

This makes the AST viewer (which annotates string constant nodes as
`Str`) a bit more consistent.
@tausbn tausbn added the no-change-note-required This PR does not need a change note label Jul 19, 2022
@tausbn tausbn requested a review from a team as a code owner July 19, 2022 12:42
Copy link
Member

@RasmusWL RasmusWL left a comment

Choose a reason for hiding this comment

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

As a fix for people using AST viewer, this LGTM! 👍

@tausbn tausbn merged commit c904ba1 into github:main Aug 22, 2022
@tausbn tausbn deleted the python-add-str-class branch August 22, 2022 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-change-note-required This PR does not need a change note Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Python AST] AST Viewer shows [Str] but no such type exists
2 participants