Skip to content

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

Closed

Description

@yohummus

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.

Activity

  1. dpranke commented on Jan 14, 2020

    @dpranke
    Owner

    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.

  2. added a commit that references this issue on Jan 31, 2020
  3. dpranke commented on Jan 31, 2020

    @dpranke
    Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions