Robert Kern wrote: > I don't want to assume that the only two sequence types are lists and arrays.
Does numpy.random.shuffle really have to work on any sequence? and without making a copy? I'm not so sure -- having num* functions operate on any sequence has been a design goal of Numeric from the beginning, but I've never thought it that important. However, it is pretty consistent across numpy, so we should probably support it here. How about two cases: 1) sequences that support copy() 2) sequences that don't -- in that case, it is assumed that indexing has copy semantics. It truth, this means: 1) numpy arrays 2) standard python mutable sequences But it does satisfy the duck typing approach. Maybe we could specifically check for copy vs. view semantics, but that seems like overkill. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
