Scott David Daniels wrote:
kirby urner wrote:
... Hey, did you know Ellipsis is a new primitive object ...
Actually, it has been around for quite a while.... [broken example]
Sorry, everybody, I started writing, tried the code, and editted the
reply, rather than taking direct quotes. In doing so, I slipped up.
I'm embarrassed enough that I'm going to re-post:
>>> class Funny(object):
def __getitem__(self, *args):
return args
>>> psuedo_array = Funny()
>>> psuedo_array[1, ..., 10]
((1, Ellipsis, 10),)
>>> Ellipsis
Ellipsis
Just to add some actual content: I believe this was first put in
to help out array processing and heavy computation projects. The
biggest survivors / descendants of those projects are Scipy & Numpy.
By the way, Funny is actually a fairly useful class for experiments.
--Scott David Daniels
scott.dani...@acm.org
_______________________________________________
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig