On Fri, Sep 17, 2010 at 9:27 AM, MRAB <pyt...@mrabarnett.plus.com> wrote:
> For the work on updating the re module there was a discussion about
> whether named capture groups should be available as attributes of the
> match object or via subscripting (or both?). Subscripting seemed
> preferable to me because:
>
> 1. Adding attributes looks too much like 'magic'.
>
> 2. What should happen if a group name conflicts with a normal attribute?
>
> 3. What should happen if a group name conflicts with a reserved word?
>
> For those reasons the new regex module uses subscripting. It's more
> Pythonic, IMHO.

I agree with 2) and 3) and in general this is probably a
"good approach".

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to