Skip to content

Commit

Permalink
Merge branch 'main' into capi-pep
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Oct 20, 2023
2 parents 69483ad + 54b14ed commit c4747a1
Show file tree
Hide file tree
Showing 7 changed files with 658 additions and 125 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ peps/pep-0727.rst @JelleZijlstra
peps/pep-0729.rst @JelleZijlstra @hauntsaninja
peps/pep-0730.rst @ned-deily
peps/pep-0731.rst @gvanrossum @encukou @vstinner @zooba @iritkatriel
peps/pep-0732.rst @Mariatta
peps/pep-0733.rst @encukou @vstinner @zooba @iritkatriel
# ...
# peps/pep-0754.rst
Expand Down
2 changes: 1 addition & 1 deletion peps/pep-0696.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PEP: 696
Title: Type defaults for TypeVarLikes
Author: James Hilton-Balfe <[email protected]>
Sponsor: Jelle Zijlstra <[email protected]>
Discussions-To: https://mail.python.org/archives/list/[email protected]/thread/7VWBZWXTCX6RAJO6GG67BAXUPFZ24NTC
Discussions-To: https://discuss.python.org/t/pep-696-type-defaults-for-typevarlikes/22569
Status: Draft
Type: Standards Track
Topic: Typing
Expand Down
18 changes: 9 additions & 9 deletions peps/pep-0698.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ method or attribute in some ancestor class.
return 2
@override
def baz() -> int: # Type check error: no matching signature in ancestor
def baz(self) -> int: # Type check error: no matching signature in ancestor
return 1
Expand Down Expand Up @@ -240,20 +240,20 @@ Consider the following code:
pass
class Child(Parent):
def foo() -> int:
def foo(self) -> int:
return 2
Imagine we refactor it as follows:


.. code-block:: python
class Parent
def foo() -> int: # This method is new
class Parent:
def foo(self) -> int: # This method is new
return 1
class Child(Parent):
def foo() -> int: # This is now an override!
def foo(self) -> int: # This is now an override!
return 2
def call_foo(parent: Parent) -> int:
Expand Down Expand Up @@ -416,22 +416,22 @@ ancestor class where the overridden method should be defined:
.. code-block:: python
class Parent0:
def foo() -> int:
def foo(self) -> int:
return 1
class Parent1:
def bar() -> int:
def bar(self) -> int:
return 1
class Child(Parent0, Parent1):
@override(Parent0) # okay, Parent0 defines foo
def foo() -> int:
def foo(self) -> int:
return 2
@override(Parent0) # type error, Parent0 does not define bar
def bar() -> int:
def bar(self) -> int:
return 2
Expand Down
2 changes: 2 additions & 0 deletions peps/pep-0702.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ The decorator takes the following arguments:

The positional-only argument is of type ``str`` and contains a message that should
be shown by the type checker when it encounters a usage of the decorated object.
Tools may clean up the deprecation message for display, for example
by using :func:`inspect.cleandoc` or equivalent logic.
The message must be a string literal.
The content of deprecation messages is up to the user, but it may include the version
in which the deprecated object is to be removed, and information about suggested
Expand Down
Loading

0 comments on commit c4747a1

Please sign in to comment.