Skip to content

invalid-sentinel - why does the argument have to be a literal? #4142

Description

@DetachHead

https://pyrefly.org/en/docs/error-kinds/#invalid-sentinel

# First argument passed to sentinel constructor isn't a string literal
my_str: str = "MISSING"
A = Sentinel(my_str)

this requirement doesn't seem to be mentioned in the docs or the PEP, but interestingly pyright also reports the same error. (ty doesn't)

i'm wondering if theres some documentation somewhere i'm missing, or if this just came from an early draft of the PEP that was later removed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions