Perl's @foo[3,7,1,-1] ?

Vito De Tullio zak.mc.kraken at libero.it
Sun Jun 14 02:55:30 EDT 2009


Jack Diederich wrote:

> the square brackets always expect an int or a slice.

true only for lists :)

In [1]: mydict = {}

In [2]: mydict[1,2,3] = 'hi'

In [3]: print mydict[1,2,3]
------> print(mydict[1,2,3])
hi


-- 
By ZeD




More information about the Python-list mailing list