[issue24454] Improve the usability of the match object named group API

Matthew Barnett report at bugs.python.org
Mon Jun 15 16:14:00 CEST 2015


Matthew Barnett added the comment:

I agree that it would be nice if len(mo) == len(mo.groups()), but Serhiy has explained why that's not the case in the regex module.

The regex module does support mo[name], so:

  print('Located coordinate at (%(row)s, %(col)s)' % mo)
  print('Located coordinate at ({row}, {col})'.format_map(mo))

already work.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24454>
_______________________________________


More information about the Python-bugs-list mailing list