-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Convert more examples to doctests in typing
module
#112194
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
Labels
docs
Documentation in the Doc dir
tests
Tests in the Lib/test dir
topic-typing
type-feature
A feature request or enhancement
Comments
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Nov 17, 2023
AlexWaygood
added a commit
that referenced
this issue
Nov 17, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 17, 2023
…thonGH-112195) (cherry picked from commit 949b2cc) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 17, 2023
…thonGH-112195) (cherry picked from commit 949b2cc) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
Feb 11, 2024
…thon#112195) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
…thon#112195) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
docs
Documentation in the Doc dir
tests
Tests in the Lib/test dir
topic-typing
type-feature
A feature request or enhancement
Feature or enhancement
There are multiple examples that are very similar to doctests, but are not doctests.
I propose adding
>>>
and...
to them, so these examples would be checked during tests (since now we have this feature).There are some easy ones, where just adding
>>>
(and some imports are enough).There are also some more complex ones, where some new types / vars are needed, but I don't think it is worth doing, because it will increase the complexity of these examples.
Examples:
cpython/Lib/typing.py
Lines 207 to 217 in 0ee2d77
cpython/Lib/typing.py
Lines 252 to 259 in 0ee2d77
cpython/Lib/typing.py
Lines 672 to 686 in 0ee2d77
cpython/Lib/typing.py
Lines 2239 to 2255 in 0ee2d77
cpython/Lib/typing.py
Lines 2268 to 2280 in 0ee2d77
cpython/Lib/typing.py
Lines 2293 to 2304 in 0ee2d77
cpython/Lib/typing.py
Lines 2899 to 2909 in 0ee2d77
This actually reveals a bug:
cpython/Lib/typing.py
Lines 207 to 219 in 0ee2d77
assert collections.abc.Callable[ParamSpec, str].__args__ == (ParamSpec, str)
example is invalid:Linked PRs
typing.py
#112195typing.py
(GH-112195) #112208typing.py
(GH-112195) #112209The text was updated successfully, but these errors were encountered: