On Thu, 27 Jul 2000, Guido van Rossum wrote: > > Here's what happens now: > > > > >>> (a, b, c) += 1,2,3 > > SyntaxError: no augmented assignment to tuple > > > > (Isn't a reference implementation a cool thing ? ;) > > Very nice. Don't touch that part. I think quite a lot of the code I wrote in compile.c for my augmented assignment patch lives on in Thomas's patch, and I was very conservative; if I couldn't work out what something should mean, I banned it (eg. a += b += c is a syntax error too). On reflection, I think I got this right. The error messages could be imporoved, I suspect. [snip to a very nearly completely different topic] > Another alternative that tries to preserve compatibility is to call > __getslice__(self, start, end) when the step is None, but > __getslice__(self, start, end, step) when it isn't. Old code will > raise a reasonable exception when a step is specified, while > step-aware code can specify the step as a default argument value of > 1 or None. Good idea. Are lists and tuples going to support seq[a:b:c] anytime soon? Patches welcome, I'd guess... Cheers, M.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4