-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-103921: Document PEP 695 #104642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-103921: Document PEP 695 #104642
Changes from 1 commit
786a436
c1f266e
040c4fd
e3dfb27
f5b1d86
5798631
0f76679
cb76021
12c1249
94a4da2
815a021
17ac785
1311399
123752c
9d6e0c0
e955a45
d7f2b55
53c4916
edec8c3
bc1c1d2
b1a843c
e690aff
cc5b51c
b0e1ce3
382ff2c
db94e4f
18b9d63
b7ba811
fd1d0a8
62ba887
200eba1
adaf874
4481d6d
365ae7b
96e5d16
0204d54
f426d39
60d7783
63d4d84
fd6751a
499dae1
b4172c9
e9bc4a8
0d37675
c94ee7c
1630342
aade45a
57b9992
7953d2c
9128c72
0511b6a
4fd3f02
fff0df4
ba2a103
1c6807d
6386475
cd4206c
e307177
d7e1c6c
f878970
a4bd32a
ee8f952
7a709d7
0cfeb92
f978766
bba092d
57ddbef
67acd98
988fc7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
|
JelleZijlstra marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -446,18 +446,18 @@ PyDoc_STRVAR(typevar_doc, | |||
| The preferred way to construct a type variable is via the dedicated syntax\n\ | ||||
| for generic functions, classes, and type aliases:\n\ | ||||
| \n\ | ||||
| class Sequence[T]: # T is a TypeVar\n\ | ||||
| ...\n\ | ||||
| class Sequence[T]: # T is a TypeVar\n\ | ||||
| ...\n\ | ||||
| \n\ | ||||
| This syntax can also be used to create bound and constrained type\n\ | ||||
| variables:\n\ | ||||
| \n\ | ||||
| class StrSequence[S: str]: # S is a TypeVar bound to str\n\ | ||||
| ...\n\ | ||||
| class StrSequence[S: str]: # S is a TypeVar bound to str\n\ | ||||
| ...\n\ | ||||
| \n\ | ||||
| \n\ | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think two line breaks are necessary here
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, fixed. Also thanks for all the thorough reviews! I am going to merge this now so I can stop worrying about conflicts.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, it's time :) |
||||
| class StrOrBytesSequence[A: (str, bytes)]: # A is a TypeVar constrained to str or bytes\n\ | ||||
| ...\n\ | ||||
| class StrOrBytesSequence[A: (str, bytes)]: # A is a TypeVar constrained to str or bytes\n\ | ||||
| ...\n\ | ||||
| \n\ | ||||
| However, if desired, reusable type variables can also be constructed\n\ | ||||
| manually, like so:\n\ | ||||
|
|
@@ -1184,7 +1184,7 @@ Just as a TypeVar (type variable) is a placeholder for a single type,\n\ | |||
| a TypeVarTuple is a placeholder for an *arbitrary* number of types. For\n\ | ||||
| example, if we define a generic class using a TypeVarTuple:\n\ | ||||
| \n\ | ||||
| class C(Generic[*Ts]): ...\n\ | ||||
| class C[*Ts]: ...\n\ | ||||
| \n\ | ||||
| Then we can parameterize that class with an arbitrary number of type\n\ | ||||
| arguments:\n\ | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.