◐ Shell
clean mode source ↗

gh-101561: Add typing.override decorator by stroxler · Pull Request #101564 · python/cpython

@stroxler stroxler changed the title PEP 698: Add typing.override decorator gh-101561: Add typing.override decorator

Feb 4, 2023

AlexWaygood

JelleZijlstra

AlexWaygood

TeamSpen210

facebook-github-bot referenced this pull request in facebook/pyre-check

Feb 9, 2023
Summary:
THe `typing_extensions.override` was added a few months ago,
we should support it.

The `typing.override` decorator isn't landed yet, but that's okay - we
should support it in override checks; it will still raise a "no such name"
method when Pyre is being run against a typeshed that doens't have it yet.

The PR to add `typing.override` to CPython is out for review now:
https://github.com/python/cpython/pull/101564`

Reviewed By: grievejia

Differential Revision: D43055550

fbshipit-source-id: 3f51f643063afea75bf54ef38ae3a48681b99bd9
Testing:

First set up the repo, following instructions
at https://devguide.python.org/ by running:
```
./configure --with-pydebug && make -j
```

Then run the typing tests:
```
./python -m test test_typing -v
```

I ran the full test suite with
```
./python -m test -j3
```
and it came back clean except for a `test_grp` failure which I seem to
get on trunk as well - likely something in my build is misconfigured
but I'm pretty sure it is unrelated to the changes here.
Correct `s/final/override` (from reusing a similar block of documentation on the `@final` decorator)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
…o6pIZ.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

JelleZijlstra

Thanks, looks good

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

carljm added a commit to carljm/cpython that referenced this pull request

Feb 28, 2023