How Python works: What do you know about support for negative indices?

Ulrich Eckhardt eckhardt at satorlaser.com
Fri Sep 10 03:36:08 EDT 2010


Raymond Hettinger wrote:
> collections.deque('abcde').__getitem__[-2]  # extension class, magic
> method

Small nit: You don't mean [square] brackets here, right?

Otherwise, good posting, thank you!

Uli

-- 
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932




More information about the Python-list mailing list