[issue16443] Add docstrings to regular expression match objects

New submission from Raymond Hettinger: The match objects currently do not have useful docstrings. An easy task is to add docstrings modeled after the text in the regular docs. import re mo = re.search('abc', 'abc') help(mo) ---------- assignee: docs@python components: Documentation keywords: easy messages: 175188 nosy: docs@python, rhettinger priority: normal severity: normal status: open title: Add docstrings to regular expression match objects type: enhancement versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett stage: -> needs patch versions: -Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Ezio Melotti added the comment: Do you mean http://docs.python.org/2/library/re.html#match-objects ? This doesn't seem to say anything too useful. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Anton Kasyanov added the comment: Created a patch with docstrings for match objects. Also added empty lines in pattern object docstrings according to http://www.python.org/dev/peps/pep-0007/#id7 ---------- keywords: +patch nosy: +a.kasyanov, asvetlov versions: -Python 2.7 Added file: http://bugs.python.org/file28403/issue-16443.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Roundup Robot added the comment: New changeset e4f1b3565509 by Andrew Svetlov in branch '3.2': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/e4f1b3565509 New changeset 64e050c2d010 by Andrew Svetlov in branch '3.3': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/64e050c2d010 New changeset e3d0417d8266 by Andrew Svetlov in branch 'default': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/e3d0417d8266 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Roundup Robot added the comment: New changeset c390dc999fcc by Andrew Svetlov in branch '2.7': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/c390dc999fcc ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Andrew Svetlov added the comment: Pushed. Thank you, Anton! ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Serhiy Storchaka added the comment: `MatchObject` term is not defined anywhere in the documentation. It will be better to use `match object` instead. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Andrew Svetlov added the comment: Fixed in #16760 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett stage: -> needs patch versions: -Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Ezio Melotti added the comment: Do you mean http://docs.python.org/2/library/re.html#match-objects ? This doesn't seem to say anything too useful. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Anton Kasyanov added the comment: Created a patch with docstrings for match objects. Also added empty lines in pattern object docstrings according to http://www.python.org/dev/peps/pep-0007/#id7 ---------- keywords: +patch nosy: +a.kasyanov, asvetlov versions: -Python 2.7 Added file: http://bugs.python.org/file28403/issue-16443.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Roundup Robot added the comment: New changeset e4f1b3565509 by Andrew Svetlov in branch '3.2': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/e4f1b3565509 New changeset 64e050c2d010 by Andrew Svetlov in branch '3.3': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/64e050c2d010 New changeset e3d0417d8266 by Andrew Svetlov in branch 'default': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/e3d0417d8266 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Roundup Robot added the comment: New changeset c390dc999fcc by Andrew Svetlov in branch '2.7': Issue #16443: Add docstrings to regular expression match objects. http://hg.python.org/cpython/rev/c390dc999fcc ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Andrew Svetlov added the comment: Pushed. Thank you, Anton! ---------- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed versions: +Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Serhiy Storchaka added the comment: `MatchObject` term is not defined anywhere in the documentation. It will be better to use `match object` instead. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________

Andrew Svetlov added the comment: Fixed in #16760 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue16443> _______________________________________
participants (6)
-
Andrew Svetlov
-
Anton Kasyanov
-
Ezio Melotti
-
Raymond Hettinger
-
Roundup Robot
-
Serhiy Storchaka