mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.11] gh-103921: Improve typing documentation (GH-104642) (#105007)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
dcfa8165ad
commit
d34e58a1d5
2 changed files with 190 additions and 158 deletions
|
|
@ -1177,17 +1177,9 @@ def add_two(x: float, y: float) -> float:
|
|||
'''Add two numbers together.'''
|
||||
return x + y
|
||||
|
||||
Parameter specification variables defined with covariant=True or
|
||||
contravariant=True can be used to declare covariant or contravariant
|
||||
generic types. These keyword arguments are valid, but their actual semantics
|
||||
are yet to be decided. See PEP 612 for details.
|
||||
|
||||
Parameter specification variables can be introspected. e.g.:
|
||||
|
||||
P.__name__ == 'P'
|
||||
P.__bound__ == None
|
||||
P.__covariant__ == False
|
||||
P.__contravariant__ == False
|
||||
|
||||
Note that only parameter specification variables defined in global scope can
|
||||
be pickled.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue