Skip to content

Variable names of the form _+keyword will be partially highlighted as a Python keyword #3210

@JonEsparaz

Description

@JonEsparaz

Describe the current behavior

A variable name of the form _+keyword (pseudo regex) will be partially highlighted as a Python keyword.

Examples:

  • _lambda
  • __lambda
  • _False

Viewing on Colab:
image

Describe the expected behavior

While these are admittedly poorly named variables, they are still valid and should not include keyword syntax highlighting. For example, viewing the same notebook on GitHub:

image

What web browser you are using
Firefox 106.0.4

Additional context
https://colab.research.google.com/gist/JonEsparaz/4d899df57f3936ef230a1c28ed33dec9/_keyword_colab_bug.ipynb

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions