-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Minor Change
At the moment, slicing a cursor with two equal values results in an exception being raised - I think it would be more in line with standard Python slicing behaviour if it limited the query to 0 results. Providing slicing support is just adding a bit of Pythonic syntactic-sugar, it might be more intuitive for people who are used to using slicing on lists and Django QuerySets to match the standard behaviour - just in the same way that when overriding _getattr, AttributeErrors are generally raised, and when overriding __getitem_, IndexErrors are usually raised - following the convention helps to avoid unexpected behaviour and means that the code will work with more existing code without modifying the existing code.