-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Doctest fails in stdtypes.rst
#106446
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
Comments
Failed doctests in
|
I get 15 failures on Windows; the additional 5 (3,4,5,6,8 in details) seem to be from long ints being 8 versus 4 bytes. Details, with error numbers added
I don't know how CI is run to avoid failures; perhaps it skips some things by examining failure. But some 'expected's are incorrect and should be changed in any case. Comments: (I assume that you got same non-matching expected on Ubuntu. I checked validity of replacement expecteds back to 3.11 to be sure we can backport.)
|
I get the same result on Windows. Please let me know if further testing or other work is required, so as not to duplicate the work you are doing~ |
I finished testing, but will 'let' you revise the PR. |
Some additions: (1, 9) The doctest docs recommend a solution to check set and address. Maybe we could use this to improve docs.
(10) The
(12) This result is correct until Python 3.10. But please consider the following examples: # Example1: In python 3.10
>>> isinstance(1, int | list[int])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: isinstance() argument 2 cannot contain a parameterized generic
# Example2: In python 3.13.0a0
>>> isinstance(1, int | list[int]) # short-circuit evaluation
True
# Example3: In python 3.13.0a0
>>> isinstance([1], int | list[int])
Traceback (most recent call last):
...
TypeError: isinstance() argument 2 cannot be a parameterized generic I guess the syntax of Python has changed. In example 2, the second operand is never evaluated (short-circuit). Only modifying the result to |
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit 89867d2) Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit 89867d2)
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>. (cherry picked from commit 89867d2) Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
--------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Documentation
When some codes are modified, the doc and doctests are not updated synchronously.
Local doctest:
Details
BTW, It seems that all doctests are passing in the CI pipeline. Those failed cases are not found by CI doctest.
See: https://github.com/CharlieZhao95/cpython/actions/runs/5461321900/jobs/9939195566
Environment:
CPython versions tested on: 3.13.0a0
Operating system and architecture: Ubuntu 22.04.1 LTS
Linked PRs
The text was updated successfully, but these errors were encountered: