[Tutor] 'slice', etc
spir
denis.spir at gmail.com
Sat Dec 7 12:04:03 CET 2013
On 12/07/2013 11:42 AM, Steven D'Aprano wrote:
>> >Are slices and subsequences transparently usable one for the other?
> Of course not. They are completely different things. A slice has to be
> applied to a sequence before you get a subsequence:
Right, thank you, Staven, that's the bit I missed.
[I knew about the common sense of slice in Python as a sysnonym of subsequence,
meaning a partial copy; so I thought this different sense I just discovered,
about slice _objects_ properly in Python, was about slice as commonly understood
in other languages (D, C++, many more); but this is yet another, third meaning!
;-). Like a slice sense2, but without pointer to the original object.]
They are more like (x)ranges, thus: an abstract representation of an interval.
Denis
More information about the Tutor
mailing list