René's URL Explorer Experiment


Title: PEP 586 – Literal Types | peps.python.org

Open Graph Title: PEP 586 – Literal Types | peps.python.org

Description: This PEP proposes adding Literal types to the PEP 484 ecosystem. Literal types indicate that some expression has literally a specific value. For example, the following function will accept only expressions that have literally the value “4”:

Open Graph Description: This PEP proposes adding Literal types to the PEP 484 ecosystem. Literal types indicate that some expression has literally a specific value. For example, the following function will accept only expressions that have literally the value “4”:

Opengraph URL: https://peps.python.org/pep-0586/

direct link

Domain: peps.python.org

color-schemelight dark
og:typewebsite
og:site_namePython Enhancement Proposals (PEPs)
og:imagehttps://peps.python.org/_static/og-image.png
og:image:altPython PEPs
og:image:width200
og:image:height200
theme-color#3776ab

Links:

Pythonhttps://www.python.org/
PEP Indexhttps://peps.python.org/
Typing-SIG listhttps://mail.python.org/archives/list/typing-sig@python.org/
Typinghttps://peps.python.org/topic/typing/
Typing-SIG messagehttps://mail.python.org/archives/list/typing-sig@python.org/message/FDO4KFYWYQEP3U2HVVBEBR3SXPHQSHYR/
Abstracthttps://peps.python.org/586#abstract
Motivation and Rationalehttps://peps.python.org/586#motivation-and-rationale
Core Semanticshttps://peps.python.org/586#core-semantics
Core behaviorhttps://peps.python.org/586#core-behavior
Equivalence of two Literalshttps://peps.python.org/586#equivalence-of-two-literals
Shortening unions of literalshttps://peps.python.org/586#shortening-unions-of-literals
Legal and illegal parameterizationshttps://peps.python.org/586#legal-and-illegal-parameterizations
Legal parameters for Literal at type check timehttps://peps.python.org/586#legal-parameters-for-literal-at-type-check-time
Illegal parameters for Literal at type check timehttps://peps.python.org/586#illegal-parameters-for-literal-at-type-check-time
Parameters at runtimehttps://peps.python.org/586#parameters-at-runtime
Literals, enums, and forward referenceshttps://peps.python.org/586#literals-enums-and-forward-references
Type inferencehttps://peps.python.org/586#type-inference
Backwards compatibilityhttps://peps.python.org/586#backwards-compatibility
Using non-Literals in Literal contextshttps://peps.python.org/586#using-non-literals-in-literal-contexts
Interactions with other types and featureshttps://peps.python.org/586#interactions-with-other-types-and-features
Intelligent indexing of structured datahttps://peps.python.org/586#intelligent-indexing-of-structured-data
Interactions with overloadshttps://peps.python.org/586#interactions-with-overloads
Interactions with genericshttps://peps.python.org/586#interactions-with-generics
Interactions with enums and exhaustiveness checkshttps://peps.python.org/586#interactions-with-enums-and-exhaustiveness-checks
Interactions with narrowinghttps://peps.python.org/586#interactions-with-narrowing
Interactions with Finalhttps://peps.python.org/586#interactions-with-final
Rejected or out-of-scope ideashttps://peps.python.org/586#rejected-or-out-of-scope-ideas
True dependent types/integer genericshttps://peps.python.org/586#true-dependent-types-integer-generics
Adding more concise syntaxhttps://peps.python.org/586#adding-more-concise-syntax
Backporting the Literal typehttps://peps.python.org/586#backporting-the-literal-type
Implementationhttps://peps.python.org/586#implementation
Related workhttps://peps.python.org/586#related-work
Acknowledgementshttps://peps.python.org/586#acknowledgements
Copyrighthttps://peps.python.org/586#copyright
Literalshttps://typing.python.org/en/latest/spec/literal.html#literal-types
typing.Literalhttps://docs.python.org/3/library/typing.html#typing.Literal
typing specs sitehttps://typing.python.org/en/latest/spec/
typing specification update processhttps://typing.python.org/en/latest/spec/meta.html
Abstracthttps://peps.python.org/586#abstract
PEP 484https://peps.python.org/pep-0484/
Motivation and Rationalehttps://peps.python.org/586#motivation-and-rationale
additional examples and discussionhttps://github.com/python/typing/issues/478
PEP 484https://peps.python.org/pep-0484/
Core Semanticshttps://peps.python.org/586#core-semantics
Core behaviorhttps://peps.python.org/586#core-behavior
handle NewTypeshttps://peps.python.org/pep-0484/#newtype-helper-function
Equivalence of two Literalshttps://peps.python.org/586#equivalence-of-two-literals
Shortening unions of literalshttps://peps.python.org/586#shortening-unions-of-literals
Legal and illegal parameterizationshttps://peps.python.org/586#legal-and-illegal-parameterizations
Legal parameters for Literal at type check timehttps://peps.python.org/586#legal-parameters-for-literal-at-type-check-time
Illegal parameters for Literal at type check timehttps://peps.python.org/586#illegal-parameters-for-literal-at-type-check-time
PEP 484https://peps.python.org/pep-0484/
Rejected or out-of-scope ideashttps://peps.python.org/586#rejected-or-out-of-scope-ideas
Parameters at runtimehttps://peps.python.org/586#parameters-at-runtime
Literals, enums, and forward referenceshttps://peps.python.org/586#literals-enums-and-forward-references
Type inferencehttps://peps.python.org/586#type-inference
Backwards compatibilityhttps://peps.python.org/586#backwards-compatibility
Using non-Literals in Literal contextshttps://peps.python.org/586#using-non-literals-in-literal-contexts
Interactions with overloadshttps://peps.python.org/586#interactions-with-overloads
Interactions with other types and featureshttps://peps.python.org/586#interactions-with-other-types-and-features
Intelligent indexing of structured datahttps://peps.python.org/586#intelligent-indexing-of-structured-data
Interactions with Finalhttps://peps.python.org/586#interactions-with-final
Interactions with overloadshttps://peps.python.org/586#interactions-with-overloads
Interactions with genericshttps://peps.python.org/586#interactions-with-generics
Rejected or out-of-scope ideashttps://peps.python.org/586#rejected-or-out-of-scope-ideas
Interactions with enums and exhaustiveness checkshttps://peps.python.org/586#interactions-with-enums-and-exhaustiveness-checks
codified within PEP 484https://peps.python.org/pep-0484/#support-for-singleton-types-in-unions
Interactions with narrowinghttps://peps.python.org/586#interactions-with-narrowing
Interactions with Finalhttps://peps.python.org/586#interactions-with-final
PEP 591https://peps.python.org/pep-0591/
PEP 591https://peps.python.org/pep-0591/
Rejected or out-of-scope ideashttps://peps.python.org/586#rejected-or-out-of-scope-ideas
True dependent types/integer genericshttps://peps.python.org/586#true-dependent-types-integer-generics
PEP 484https://peps.python.org/pep-0484/
Adding more concise syntaxhttps://peps.python.org/586#adding-more-concise-syntax
Backporting the Literal typehttps://peps.python.org/586#backporting-the-literal-type
Implementationhttps://peps.python.org/586#implementation
Related workhttps://peps.python.org/586#related-work
Check that literals belong to/are excluded from a set of valueshttps://github.com/python/typing/issues/478
Simple dependent typeshttps://github.com/python/mypy/issues/3062
Typing for multi-dimensional arrayshttps://github.com/python/typing/issues/513
literal types are handled in TypeScripthttps://www.typescriptlang.org/docs/handbook/advanced-types.html#string-literal_types
Acknowledgementshttps://peps.python.org/586#acknowledgements
Copyrighthttps://peps.python.org/586#copyright
Abstracthttps://peps.python.org/586#abstract
Motivation and Rationalehttps://peps.python.org/586#motivation-and-rationale
Core Semanticshttps://peps.python.org/586#core-semantics
Core behaviorhttps://peps.python.org/586#core-behavior
Equivalence of two Literalshttps://peps.python.org/586#equivalence-of-two-literals
Shortening unions of literalshttps://peps.python.org/586#shortening-unions-of-literals
Legal and illegal parameterizationshttps://peps.python.org/586#legal-and-illegal-parameterizations
Legal parameters for Literal at type check timehttps://peps.python.org/586#legal-parameters-for-literal-at-type-check-time
Illegal parameters for Literal at type check timehttps://peps.python.org/586#illegal-parameters-for-literal-at-type-check-time
Parameters at runtimehttps://peps.python.org/586#parameters-at-runtime
Literals, enums, and forward referenceshttps://peps.python.org/586#literals-enums-and-forward-references
Type inferencehttps://peps.python.org/586#type-inference
Backwards compatibilityhttps://peps.python.org/586#backwards-compatibility
Using non-Literals in Literal contextshttps://peps.python.org/586#using-non-literals-in-literal-contexts
Interactions with other types and featureshttps://peps.python.org/586#interactions-with-other-types-and-features
Intelligent indexing of structured datahttps://peps.python.org/586#intelligent-indexing-of-structured-data
Interactions with overloadshttps://peps.python.org/586#interactions-with-overloads
Interactions with genericshttps://peps.python.org/586#interactions-with-generics
Interactions with enums and exhaustiveness checkshttps://peps.python.org/586#interactions-with-enums-and-exhaustiveness-checks
Interactions with narrowinghttps://peps.python.org/586#interactions-with-narrowing
Interactions with Finalhttps://peps.python.org/586#interactions-with-final
Rejected or out-of-scope ideashttps://peps.python.org/586#rejected-or-out-of-scope-ideas
True dependent types/integer genericshttps://peps.python.org/586#true-dependent-types-integer-generics
Adding more concise syntaxhttps://peps.python.org/586#adding-more-concise-syntax
Backporting the Literal typehttps://peps.python.org/586#backporting-the-literal-type
Implementationhttps://peps.python.org/586#implementation
Related workhttps://peps.python.org/586#related-work
Acknowledgementshttps://peps.python.org/586#acknowledgements
Copyrighthttps://peps.python.org/586#copyright
Page Source (GitHub)https://github.com/python/peps/blob/main/peps/pep-0586.rst?plain=1
https://github.com/python/peps/blob/main/peps/pep-0586.rsthttps://github.com/python/peps/blob/main/peps/pep-0586.rst
2025-02-01 07:28:42 UTChttps://github.com/python/peps/commits/main/peps/pep-0586.rst

Viewport: width=device-width, initial-scale=1.0


URLs of crawlers that visited me.