kennethreitz / records

SQL for Humans™
https://pypi.python.org/pypi/records/
ISC License
7.16k stars 574 forks source link

fix for RecordCollection slicing bug #154

Closed arokosaki closed 7 months ago

arokosaki commented 6 years ago

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.