Commit Graph
3 Commits
Author SHA1 Message Date
M Bussonnier 8bd178e0c6 Fix: incorrect type for Bdb.format_stack_entry (#13485)
```python
    def format_stack_entry(self, frame_lineno, lprefix=': '):
         ...
        frame, lineno = frame_lineno
```

The type of `frame_lineno` is `tuple[FrameType, int]` not `int`,
understandably, since the type of `frame_lineno` can be interprted as
the line number of the frame. But looking at the implementation of
`Bdb.format_stack_entry`, it is clear that `frame_lineno` is a tuple.

It is also necessary to somehow pass a frame to `format_stack_entry` if
we want it to be formatted...
2025-02-09 21:32:56 +00:00
M Bussonnier b17ed95818 Docutils: wrong type: SystemMessage vs system_message (#12314) 2024-07-10 17:50:52 +02:00
M Bussonnier edf41ae5e2 Update type of Formatter.convert_field (missing |None) (#11377)
From the source it expects that the second parameter (conversion), can
be None:

```python
   def convert_field(self, value, conversion):
        # do any conversion on the resulting object
        if conversion is None:
            return value
   ...
```

Since at least 17 years according to git blame, as None is refered as
early as 11529195cae2438a3ac003babcb1b11af67c4037
And still present in main branch:

https://github.com/python/cpython/blob/ef3ceab09d2d0959c343c662461123d5b0e0b64b/Lib/string.py
2024-02-07 19:24:21 +00:00