René's URL Explorer Experiment


Title: PEP 742 – Narrowing types with TypeIs | peps.python.org

Open Graph Title: PEP 742 – Narrowing types with TypeIs | peps.python.org

Description: This PEP proposes a new special form, TypeIs, to allow annotating functions that can be used to narrow the type of a value, similar to the builtin isinstance(). Unlike the existing typing.TypeGuard special form, TypeIs can narrow the type in both the if...

Open Graph Description: This PEP proposes a new special form, TypeIs, to allow annotating functions that can be used to narrow the type of a value, similar to the builtin isinstance(). Unlike the existing typing.TypeGuard special form, TypeIs can narrow the type in both the if...

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

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/
Discourse threadhttps://discuss.python.org/t/pep-742-narrowing-types-with-typenarrower/45613
Typinghttps://peps.python.org/topic/typing/
11-Feb-2024https://discuss.python.org/t/pep-742-narrowing-types-with-typenarrower/45613
724https://peps.python.org/pep-0724/
03-Apr-2024https://discuss.python.org/t/pep-742-narrowing-types-with-typeis/45613/35
Abstracthttps://peps.python.org/742#abstract
Motivationhttps://peps.python.org/742#motivation
Rationalehttps://peps.python.org/742#rationale
Specificationhttps://peps.python.org/742#specification
Type narrowing behaviorhttps://peps.python.org/742#type-narrowing-behavior
Exampleshttps://peps.python.org/742#examples
Subtypinghttps://peps.python.org/742#subtyping
Backwards Compatibilityhttps://peps.python.org/742#backwards-compatibility
Security Implicationshttps://peps.python.org/742#security-implications
How to Teach Thishttps://peps.python.org/742#how-to-teach-this
When to use TypeIshttps://peps.python.org/742#when-to-use-typeis
Writing a safe TypeIs functionhttps://peps.python.org/742#writing-a-safe-typeis-function
TypeIs and TypeGuardhttps://peps.python.org/742#typeis-and-typeguard
Reference Implementationhttps://peps.python.org/742#reference-implementation
Rejected Ideashttps://peps.python.org/742#rejected-ideas
Change the behavior of TypeGuardhttps://peps.python.org/742#change-the-behavior-of-typeguard
Do nothinghttps://peps.python.org/742#do-nothing
Alternative nameshttps://peps.python.org/742#alternative-names
Acknowledgmentshttps://peps.python.org/742#acknowledgments
Copyrighthttps://peps.python.org/742#copyright
TypeIshttps://typing.python.org/en/latest/spec/narrowing.html#typeis
typing.TypeIshttps://docs.python.org/3.13/library/typing.html#typing.TypeIs
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/742#abstract
isinstance()https://docs.python.org/3/builtins/functions.html#isinstance
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
Motivationhttps://peps.python.org/742#motivation
isinstance()https://docs.python.org/3/builtins/functions.html#isinstance
PEP 647https://peps.python.org/pep-0647/
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
PEP 724https://peps.python.org/pep-0724/
inspect.isawaitable()https://docs.python.org/3/library/inspect.html#inspect.isawaitable
typeshedhttps://github.com/python/typeshed/blob/a4f81a67a07c18dd184dd068c459b02e71bcac22/stdlib/inspect.pyi#L219
reportedhttps://github.com/python/mypy/issues/15520
PEP 647https://peps.python.org/pep-0647/
Python typing issuehttps://github.com/python/typing/issues/996
Python typing issuehttps://github.com/python/typing/issues/1351
dataclasses.is_dataclass()https://docs.python.org/3/library/dataclasses.html#dataclasses.is_dataclass
Pyright issuehttps://github.com/microsoft/pyright/issues/3450
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
isinstance()https://docs.python.org/3/builtins/functions.html#isinstance
Pyright issuehttps://github.com/microsoft/pyright/issues/3466
Mypy issuehttps://github.com/python/mypy/issues/13957
Mypy issuehttps://github.com/python/mypy/issues/14434
Mypy issuehttps://github.com/python/mypy/issues/15305
Mypy issuehttps://github.com/python/mypy/issues/11907
inspect.isawaitable()https://docs.python.org/3/library/inspect.html#inspect.isawaitable
Typeshed issuehttps://github.com/python/typeshed/issues/8009
Rationalehttps://peps.python.org/742#rationale
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
PEP 724https://peps.python.org/pep-0724/
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
believehttps://peps.python.org/742#pep-742-change-typeguard
Specificationhttps://peps.python.org/742#specification
typinghttps://docs.python.org/3/library/typing.html#module-typing
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
Type narrowing behaviorhttps://peps.python.org/742#type-narrowing-behavior
consistent withhttps://peps.python.org/pep-0483/#pep-483-gradual-typing
isinstance()https://docs.python.org/3/builtins/functions.html#isinstance
Exampleshttps://peps.python.org/742#examples
Subtypinghttps://peps.python.org/742#subtyping
Backwards Compatibilityhttps://peps.python.org/742#backwards-compatibility
Security Implicationshttps://peps.python.org/742#security-implications
How to Teach Thishttps://peps.python.org/742#how-to-teach-this
isinstance()https://docs.python.org/3/builtins/functions.html#isinstance
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
When to use TypeIshttps://peps.python.org/742#when-to-use-typeis
Writing a safe TypeIs functionhttps://peps.python.org/742#writing-a-safe-typeis-function
TypeIs and TypeGuardhttps://peps.python.org/742#typeis-and-typeguard
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
Reference Implementationhttps://peps.python.org/742#reference-implementation
has been implementedhttps://github.com/python/typing_extensions/pull/330
pull request openhttps://github.com/python/mypy/pull/16898
pull requesthttps://github.com/quora/pyanalyze/pull/718
added in version 1.1.351https://github.com/microsoft/pyright/releases/tag/1.1.351
Rejected Ideashttps://peps.python.org/742#rejected-ideas
Change the behavior of TypeGuardhttps://peps.python.org/742#change-the-behavior-of-typeguard
PEP 724https://peps.python.org/pep-0724/
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
PEP 647https://peps.python.org/pep-0647/
PEP 724https://peps.python.org/pep-0724/
Do nothinghttps://peps.python.org/742#do-nothing
PEP 724https://peps.python.org/pep-0724/
Alternative nameshttps://peps.python.org/742#alternative-names
TypeScript’s syntaxhttps://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
post by Paul Moorehttps://discuss.python.org/t/pep-724-stricter-type-guards/34124/60
isinstance()https://docs.python.org/3/builtins/functions.html#isinstance
PEP 724https://peps.python.org/pep-0724/
typing.TypeGuardhttps://docs.python.org/3/library/typing.html#typing.TypeGuard
post by Nicolas Tessorehttps://discuss.python.org/t/pep-724-stricter-type-guards/34124/59
Acknowledgmentshttps://peps.python.org/742#acknowledgments
PEP 724https://peps.python.org/pep-0724/
PEP 724https://peps.python.org/pep-0724/
Copyrighthttps://peps.python.org/742#copyright
Abstracthttps://peps.python.org/742#abstract
Motivationhttps://peps.python.org/742#motivation
Rationalehttps://peps.python.org/742#rationale
Specificationhttps://peps.python.org/742#specification
Type narrowing behaviorhttps://peps.python.org/742#type-narrowing-behavior
Exampleshttps://peps.python.org/742#examples
Subtypinghttps://peps.python.org/742#subtyping
Backwards Compatibilityhttps://peps.python.org/742#backwards-compatibility
Security Implicationshttps://peps.python.org/742#security-implications
How to Teach Thishttps://peps.python.org/742#how-to-teach-this
When to use TypeIshttps://peps.python.org/742#when-to-use-typeis
Writing a safe TypeIs functionhttps://peps.python.org/742#writing-a-safe-typeis-function
TypeIs and TypeGuardhttps://peps.python.org/742#typeis-and-typeguard
Reference Implementationhttps://peps.python.org/742#reference-implementation
Rejected Ideashttps://peps.python.org/742#rejected-ideas
Change the behavior of TypeGuardhttps://peps.python.org/742#change-the-behavior-of-typeguard
Do nothinghttps://peps.python.org/742#do-nothing
Alternative nameshttps://peps.python.org/742#alternative-names
Acknowledgmentshttps://peps.python.org/742#acknowledgments
Copyrighthttps://peps.python.org/742#copyright
Page Source (GitHub)https://github.com/python/peps/blob/main/peps/pep-0742.rst?plain=1
https://github.com/python/peps/blob/main/peps/pep-0742.rsthttps://github.com/python/peps/blob/main/peps/pep-0742.rst
2024-10-17 12:49:39 UTChttps://github.com/python/peps/commits/main/peps/pep-0742.rst

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


URLs of crawlers that visited me.