[issue22843] doc error: 6.2.4. Match Objects

2021-09-10 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-b

[issue22843] doc error: 6.2.4. Match Objects

2014-11-14 Thread Clayton Kirkwood
Clayton Kirkwood added the comment: Cool >-Original Message- >From: Terry J. Reedy [mailto:rep...@bugs.python.org] >Sent: Friday, November 14, 2014 1:04 PM >To: c...@godblessthe.us >Subject: [issue22843] doc error: 6.2.4. Match Objects > > >Terry J. Reedy added

[issue22843] doc error: 6.2.4. Match Objects

2014-11-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: David is correct that the current phrasing is correct. The phase 'x has a boolean value of True' means 'bool(x) is True', which is always true for match objects, as well as for non-zero numbers, non-empty collections, and many other things. This does *not* i

[issue22843] doc error: 6.2.4. Match Objects

2014-11-12 Thread Ben Finney
Ben Finney added the comment: The current wording of the passage “Match objects always have a boolean value of True” implies that the value compares equal to the ‘True’ constant. That implication is incorrect. I disagree with R. David Murray; if we want to say that a value is considered true

[issue22843] doc error: 6.2.4. Match Objects

2014-11-11 Thread Georg Brandl
Georg Brandl added the comment: "evaluates true" should not be used in any case, the objects do not equal to True in any case. The phrase "is considered true in a boolean context" is already in the docs and could be used here too. -- nosy: +georg.brandl __

[issue22843] doc error: 6.2.4. Match Objects

2014-11-10 Thread R. David Murray
R. David Murray added the comment: That's what "have a boolean value of True" means. (ie: bool() is True). I'm neutral on whether or not it is worth changing the wording. -- nosy: +r.david.murray type: resource usage -> behavior ___ Python tracker

[issue22843] doc error: 6.2.4. Match Objects

2014-11-10 Thread Clayton Kirkwood
New submission from Clayton Kirkwood: Documentation says: > Match objects always have a boolean value of True. Since match() and > search() return None when there is no match, you can test whether > there was a match with a simple if statement: > > match = re.search(pattern, string) > if match: