On Thu, Dec 07, 2006, Alastair Houghton wrote: > > An example where it might be useful: > > m = re.match('(?:([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+) (?P<rect>rect)' > '|([0-9]+) ([0-9]+) ([0-9]+) (?P<circle>circle))', > lineFromFile) > > if m['rect']: > drawRectangle(m[1:5]) > elif m['circle']: > drawCircle(m[1:3], m[3]) > > Is that really so outlandish? Likely; normally I would expect that drawRectangle would break on string arguments instead of ints. I think that the amount of usefulness compared to problems doesn't really make this worth it. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ Member of the Groucho Marx Fan Club
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