Help with Python Grammar change
Timothy Docker
timd at macquarie.com.au
Tue Feb 15 17:46:54 EST 2000
More information about the Python-list mailing list
Tue Feb 15 17:46:54 EST 2000
- Previous message (by thread): Help with Python Grammar change
- Next message (by thread): BSDDB Pack function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Travis Oliphant <olipt at mayo.edu> writes: > If a is a 3-dimensional array currently > > a[:,:,5] returns a reference to a two-dimensional sub-array. > > It would be useful if a(:,:,5) returned a copy to that array. Using the > current grammar we could make a(slice(None),slice(None),5) return the > copy, but it is definitely not as clever. You could have a subobject in a with a __getindex__ method, that does the copy, as opposed to the __getindex__ method in a, that returns the reference, ie a[:,:,5] returns a reference to a two-dimensional sub-array. a.copy[:,:,5] returns a copy of that array. Tim
- Previous message (by thread): Help with Python Grammar change
- Next message (by thread): BSDDB Pack function?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list