Commit 824e5fc
committed
fix: add isinstance(to, str) guard for pyright type narrowing
Pyright cannot narrow to str after isinstance(to, int) since bool is
a subclass of int. Wrapping the string-only code path in an explicit
isinstance(to, str) check resolves the type error.1 parent 13ccbe4 commit 824e5fc
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
0 commit comments