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
DocTest sorts by lineno which may be int or None #94722
Comments
Can that happen despite equal names and equal filenames? |
I'm reporting this because I actually was getting 'int < None not valid' exceptions from this comparison. I would have included a repro but the way i was triggering it was complex enough that it really wasn't worth the time. It involved pybind, installing from sdist not wheel, machine architecture detection, patching in a Even if that "names same implies lineno not null" invariant did in fact hold, that invariant is pretty complicated. It would need to be documented. Much easier to just replace |
…side (pythonGH-112385) (cherry picked from commit fbb9027) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
…side (pythonGH-112385) (cherry picked from commit fbb9027) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
In
doctest.py
the following ordering is defined for the classDocTest
:This is incorrect because the
lineno
field may be an integer and may be None, and comparisons between integers and None fail. Typicallylineno
is an integer, but_find_lineno
explicitly can fall back to returningNone
so the field may be None:Linked PRs
The text was updated successfully, but these errors were encountered: