[Python-3000] indexing wart

Neal Becker ndbecker2 at gmail.com
Wed Mar 5 12:33:07 CET 2008


It is a bit unfortunate that slicing has a singularity.
samples_to_trim = (some calculation yielding an integer >= 0)
trimmed_vector = vector[:-samples_to_trim] if samples_to_trim != 0 else
vector[:]
A bit unfortunate that the case of samples_to_trim == 0 has to be handled
differently.
I don't really see any solution to this.


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /