Commit a5bbe2f
committed
Loosen parameters of format_list and from_list
Never ask for a List when asking for a MutableSequence will do. Never
ask for a MutableSequence when asking for a Sequence will do. Never ask
for a Sequence when asking for a Collection will do. Never ask for a
Collection when asking for an Iterable will do.
Also drop support for Tuple[str, int, str, Optional[str]] elements in
the iterables passed to traceback.format_list and
traceback.StackSummary.from_list - if authors are diligent enough to be
type-checking their code, they are diligent enough to be making use of
their dependencies according to their preferred semantics rather than
their backwards-compatibility carve-outs.1 parent cca6ee4 commit a5bbe2f
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
114 | 121 | | |
115 | | - | |
| 122 | + | |
116 | 123 | | |
0 commit comments