Message398226
This code
match range(42):
case [x, *w, y]:
z = 0
sets w to a list with 40 items : the length of the subject, minus the number of non-star subpatterns.
But this code (adapted from test_patma_186) enters an infinite loop
import collections.abc
class Seq(collections.abc.Sequence):
def __getitem__(self, i):
print('get item', i)
return i
def __len__(self):
return 42
match Seq():
case [x, *w, y]:
z = 0
__getitem__ gets called forever, instead of stopping when the expected number of items in w is reached. |
|
Date |
User |
Action |
Args |
2021-07-26 14:23:39 | quentel | set | recipients:
+ quentel |
2021-07-26 14:23:39 | quentel | set | messageid: <1627309419.51.0.550971310919.issue44741@roundup.psfhosted.org> |
2021-07-26 14:23:39 | quentel | link | issue44741 messages |
2021-07-26 14:23:39 | quentel | create | |
|