Fredrik Lundh wrote: > the problem with slicing is that people may 1) expect a slice to return > a new object *of the same type* (which opens up a *gigantic* can of > worms, both on the implementation level and on the wtf-is-this-thing- > really level), and 2) expect things like [::-1] to work, which opens up > another can of worms. I prefer the "If the implementation is easy to > explain, it may be a good idea." design principle over "can of worms" > design principle. This is a good point - I know I consider "m[0:0] == type(m)()" to be a property a well-behaved sequence should preserve. Since match objects can't really do that, better not to pretend to be a sequence at all. With slicing out of the equation, that only leaves the question of whether or not len(m) should work. I believe it would be nice for len(m) to be supported, so that reversed(m) works along with iter(m). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
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