from collections import namedtuple
from records import RecordCollection
IdRecord = namedtuple('IdRecord', 'id')
r = RecordCollection(IdRecord(i) for i in range(10))
r[:]
you get the error:
File "C:\Users\kobi\PycharmProjects\records\records.py", line 150, in getitem
while len(self) < key.stop or key.stop is None:
TypeError: '<' not supported between instances of 'int' and 'NoneType'
I changed the order of the two expressions in the 'or' clause and it now works.
steps to reproduce
type in to console:
from collections import namedtuple from records import RecordCollection IdRecord = namedtuple('IdRecord', 'id') r = RecordCollection(IdRecord(i) for i in range(10)) r[:]
you get the error:
File "C:\Users\kobi\PycharmProjects\records\records.py", line 150, in getitem while len(self) < key.stop or key.stop is None: TypeError: '<' not supported between instances of 'int' and 'NoneType'
I changed the order of the two expressions in the 'or' clause and it now works.