A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-December/070274.html below:

[Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects

[Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objects [Python-Dev] [NPERS] Re: a feature i'd like to see in python #2: indexing of match objectsAahz aahz at pythoncraft.com
Thu Dec 7 20:16:38 CET 2006
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  
More information about the Python-Dev mailing list

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