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

Identifiers starting with a reserved keyword are treated as reserved keywords #29

Closed
yohummus opened this issue Oct 11, 2019 · 2 comments

Comments

@yohummus
Copy link

First of all, thank you for this great library!

I noticed that dump() puts quotes around identifiers that only start with a reserved keyword. For example: internal_parameter would be dumped as "internal_parameter".

The issue seems to be in the regex that is created in lib._is_reserved_word(). Just appending $ to the whole pattern so that it reads _reserved_word_re = re.compile('|'.join(['break', ..., 'with']) + '$') fixes it.

@dpranke
Copy link
Owner

dpranke commented Jan 14, 2020

I apologize for the delay in getting to this. You're right, it's a bug, and I'll try to get a patch posted shortly.

@dpranke
Copy link
Owner

dpranke commented Jan 31, 2020

Okay, this should be fixed now in v0.9.0, which is live on PyPI.

@dpranke dpranke closed this as completed Jan 31, 2020
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

No branches or pull requests

2 participants