Oct. 1, 2019
10:21 a.m.
On Mon, Sep 30, 2019 at 06:00:44PM +0900, Stephen J. Turnbull wrote:
Technical questions: does "Subscriptable" mean non-negative ints only, or does it include the negative "count from the end" protocol? How about slices?
It means the class defines a __getitem__ method. Like __call__, the semantics of that method, and the range of acceptable arguments, is out of scope of the ABC. I don't believe that Python has any way to check the semantics of a method call, except to call it and see what it does. -- Steve (the other one)