Ticket #949 (new defect)

Opened 6 years ago

_ListWrapper does not allow for __index__ or slicing

Reported by: astronouth7303 Owned by: ehabkost
Priority: normal Milestone: OpenSync 0.40
Component: OpenSync: Python Wrapper Version: 0.38
Severity: normal Keywords:
Cc:

Description

PEP 357 (Allowing Any Object to be Used for Slicing) defines the __index__() method, which allows for any object to act as a true integer. However, _ListWrapper.__getitem__() does not allow for objects which define this method.

Additionally, slicing on _ListWrapper is impossible because no __getslice__ (deprecated) is defined and __getitem__ will throw an error if a slice is passed.

Note: See TracTickets for help on using tickets.