Files
typeshed/stdlib/2and3
wouter bolsterlee 83e955b52f Use correct return type annotation for BaseException.with_traceback (#4298)
The return type of the BaseException.with_traceback() method [1] is not
specific enough. The return type is guaranteed to be of the same type as
‘self’, which is usually a subclass of BaseException.

In fact, .with_traceback() returns ‘self’:

    try:
        raise ValueError
    except Exception as exc:
        assert exc.with_traceback(None) is exc

Fix the annotation to reflect this using the self-type annotation
technique described in PEP484 [2], which is supported by (at least)
mypy [3].

[1] https://docs.python.org/3/library/exceptions.html#BaseException.with_traceback
[2] https://www.python.org/dev/peps/pep-0484/#annotating-instance-and-class-methods
[3] https://github.com/python/mypy/issues/1212
2020-06-30 11:40:25 -07:00
..
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2017-03-19 13:08:54 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-29 00:00:21 -07:00
2020-06-28 13:31:00 -07:00
2020-06-28 13:31:00 -07:00