Possible to slice a string with unpacked tuple?

python at bdurham.com python at bdurham.com
Sun Jan 25 00:06:15 CET 2009


> Does myString[myTuple[0] : myTuple[1]] count as unpacking? 

I'm not sure my use of the term 'unpacking' was totally correct, but,
yes, that's what I was hoping to avoid with a simpler solution.

> then how about myString.__getslice__(*myTuple)?

Very interesting.

I'm going to try Ben's slice() object suggestion.

Thanks for your help,

More information about the Python-list mailing list