Skip to content

Use the same token and node class for all string-like literals #193

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

Closed
JukkaL opened this issue Jul 5, 2013 · 6 comments
Closed

Use the same token and node class for all string-like literals #193

JukkaL opened this issue Jul 5, 2013 · 6 comments
Labels
refactoring Changing mypy's internals topic-parser

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 5, 2013

It would reduce code duplication if the same class would be used for string and bytes literals (and unicode literals, after they have been implemented). This applies both to tokens and ast nodes.

@JukkaL JukkaL removed the front end label Jul 25, 2014
@gvanrossum
Copy link
Member

@ddfisher We discussed this idea last week...

@ddfisher
Copy link
Collaborator

Python 3 has separate Str and Bytes ast nodes, so I'm not sure that we want to make this change...

@gnprice gnprice added this to the Undetermined priority milestone Aug 11, 2016
@gvanrossum
Copy link
Member

I think the idea is to have a single node class with the data and a flag or enum giving what form of literal it was.

@ddfisher
Copy link
Collaborator

Yeah, that was what I gathered. My guess is we'll want to move to Python 3's ast, though, which still has split Str/Bytes nodes.

@gvanrossum
Copy link
Member

gvanrossum commented Aug 12, 2016 via email

@gvanrossum
Copy link
Member

Honestly I don't think this is causing much anguish. I'm just going to close it. The status quo is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Changing mypy's internals topic-parser
Projects
None yet
Development

No branches or pull requests

4 participants