Bryan Olson wrote: > Currently, user-defined classes can implement Python > subscripting and slicing without implementing Python's len() > function. In our proposal, the '$' symbol stands for the > sequence's length, so classes must be able to report their > length in order for $ to work within their slices and > indexes. > > Specifically, to support new-style slicing, a class that > accepts index or slice arguments to any of: > > __getitem__ > __setitem__ > __delitem__ > __getslice__ > __setslice__ > __delslice__ > > must also consistently implement: > > __len__ > > Sane programmers already follow this rule.
Incorrect. Some sane programmers have multiple dimensions they need to index. from Numeric import * A = array([[0, 1], [2, 3], [4, 5]]) A[$-1, $-1] The result of len(A) has nothing to do with the second $. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list