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 ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/
Member of the Groucho Marx Fan Club
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com