Serhiy Storchaka added the comment:

The disadvantage of supporting len() is its ambiguousness. Supporting indexing 
with group name also has disadvantages (benefits already was mentioned above).

1. Indexing with string keys is a part of mapping protocol, and it would be 
expected that other parts of the protocol if not all are supported (at least 
len() and iteration), but they are not.

2. If indexing with group names would be supported, it would be expected the 
support of integer indexes. But this is ambiguous too.

This feature would improve the access to named groups (6 characters less to 
type for every case and better readability), but may be implementing access via 
attributes would be even better? mo.groupnamespace().col or mo.ns.col?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24454>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to