Skip to content

Use constants instead of hard-coded strings in Tools/cases_generator #122449

Closed as not planned
@picnixz

Description

@picnixz

Feature or enhancement

Proposal:

I suggest improving the token kind checks tkn.kind == "<hardcoded string>" by using the corresponding lexer's constant string (which already exists). Some portion of the code already does it but not everywhere. We can also do the same for other kind of constructions where hard-coded strings could be replaced by constants, both for the semantics and for safety.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions