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/070141.html below:

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

[Python-Dev] a feature i'd like to see in python #2: indexing of match objects [Python-Dev] a feature i'd like to see in python #2: indexing of match objects"Martin v. Löwis" martin at v.loewis.de
Sun Dec 3 15:22:56 CET 2006
Ben Wing schrieb:
> this one is fairly simple.  if `m' is a match object, i'd like to be
> able to write m[1] instead of m.group(1). (similarly, m[:] should return
> the same as list(m.groups()).) this would remove some of the verbosity
> of regexp code, with probably a net gain in readability; certainly no loss.

Please post a patch to sf.net/projects/python (or its successor).

Several issues need to be taken into account:
- documentation and test cases must be updated to integrate the new API
- for slicing, you need to consider not only omitted indices, but also
  "true" slices (e.g. m[1:5])
- how should you deal with negative indices?
- should len(m) be supported?

Regards,
Martin
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