Skip to content

Python: Add Str class#9852

Merged
tausbn merged 2 commits into
github:mainfrom
tausbn:python-add-str-class
Aug 22, 2022
Merged

Python: Add Str class#9852
tausbn merged 2 commits into
github:mainfrom
tausbn:python-add-str-class

Conversation

@tausbn
Copy link
Copy Markdown
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
Copy Markdown
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