[issue16304] re: Match Objects always have a boolean value of True

2012-11-03 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks for the patch! I committed a slightly modified version. -- assignee: docs@python -> ezio.melotti resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker

[issue16304] re: Match Objects always have a boolean value of True

2012-11-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset dc96df8556d8 by Ezio Melotti in branch '2.7': #16304: clarify match objects docs. Initial patch by Jan Duzinkiewicz. http://hg.python.org/cpython/rev/dc96df8556d8 New changeset 1805fc284201 by Ezio Melotti in branch '3.2': #16304: clarify match obj

[issue16304] re: Match Objects always have a boolean value of True

2012-11-03 Thread Éric Araujo
Éric Araujo added the comment: Thanks for the patch. Note that :const:`True` should be ``True``. -- nosy: +eric.araujo ___ Python tracker ___ ___

[issue16304] re: Match Objects always have a boolean value of True

2012-11-02 Thread Jan Duzinkiewicz
Jan Duzinkiewicz added the comment: I agree this is unclear - If Match object always have a boolean value of True, it actually prevents me from using simple if statement - what's the point of "if True:" statement? - so the remark that matching functions do not always return match objects has s

[issue16304] re: Match Objects always have a boolean value of True

2012-10-26 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +easy nosy: +ezio.melotti stage: -> needs patch type: -> enhancement ___ Python tracker ___ _

[issue16304] re: Match Objects always have a boolean value of True

2012-10-23 Thread R. David Murray
R. David Murray added the comment: Yeah, distant was a poor choice of words. The issue really comes up if you happen to start reading with that section (say when revisiting the docs with an imperfect memory of what you read before). So, I agree that no change is *required*. But adding the ex

[issue16304] re: Match Objects always have a boolean value of True

2012-10-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think the relevant information -- that re match and search return None in the case of no match -- is that distant from the paragraph quoted. This fact is already mentioned FOUR times in the page, in each of the re.match, re.search functions and regex.

[issue16304] re: Match Objects always have a boolean value of True

2012-10-23 Thread R. David Murray
R. David Murray added the comment: Since the quoted paragraph is distant from where the information about the ``None`` return is documented, the wording of the quoted paragraph can be improved to make this clearer: Match Objects always have a boolean value of ``True``. Since ``None`` (which

[issue16304] re: Match Objects always have a boolean value of True

2012-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The documentation is okay. :func:`match` returns a Match object (which have a boolean value of True) if match and None (which have a boolean value of False) if doesn't match. -- nosy: +serhiy.storchaka ___ Python

[issue16304] re: Match Objects always have a boolean value of True

2012-10-23 Thread Vladimir Rutsky
New submission from Vladimir Rutsky: re module documentation says: Match Objects always have a boolean value of :const:`True`, so that you can test whether e.g. :func:`match` resulted in a match with a simple if statement. which is confusing - matched objects have boolean value True, doesn