Skip to content

Pylint regex conflicts with constant naming convention taught in lesson #73

@3aluw

Description

@3aluw

In the learning mode "Variables" concept lesson, it is stated that constants should be named in all uppercase with underscores (e.g., NUMBER_OF_BILLS).

However, when following this convention at numbers' concept exercise, Pylint in the provided environment reports the following error:

Variable name "NUMBER_OF_BILLS" doesn't conform to '^[a-z_][a-z0-9_]{1,30}$' pattern
Image

This happens because the Pylint configuration enforces the regex:

variable-rgx=^[a-z_][a-z0-9_]{1,30}$

which only allows lowercase variable names and does not account for uppercase constants.

Expected behavior:
If the course teaches constants should be all uppercase, the Pylint configuration should be updated to allow uppercase names for constants. For example, using something like:

const-rgx=^[A-Z_][A-Z0-9_]{1,30}$

Additional context:
The current mismatch can confuse learners who follow the lesson’s guidance but receive style errors for doing so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions