Commit 0a5235a
committed
Treat Literal["xyz"] as iterable
The extra condition that excluded LiteralType was introduced in #14827
I see no particular reason to have an instance check at all
I was looking at this because of this comment from Emma
#15511 (comment)
Previously we errored with `"Literal['xy']" object is not iterable`
which is of course totally false
Now I issue the same error as in the str case, but restrict to cases
where the unpack length does not match1 parent c2a9642 commit 0a5235a
2 files changed
+34
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4117 | 4117 | | |
4118 | 4118 | | |
4119 | 4119 | | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
4120 | 4130 | | |
| 4131 | + | |
4121 | 4132 | | |
4122 | 4133 | | |
4123 | 4134 | | |
| |||
4363 | 4374 | | |
4364 | 4375 | | |
4365 | 4376 | | |
4366 | | - | |
4367 | | - | |
4368 | | - | |
| 4377 | + | |
4369 | 4378 | | |
4370 | 4379 | | |
4371 | 4380 | | |
| |||
7803 | 7812 | | |
7804 | 7813 | | |
7805 | 7814 | | |
7806 | | - | |
7807 | | - | |
7808 | | - | |
| 7815 | + | |
7809 | 7816 | | |
7810 | 7817 | | |
7811 | 7818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2505 | 2505 | | |
2506 | 2506 | | |
2507 | 2507 | | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
0 commit comments