This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author crkirkwood
Recipients crkirkwood, docs@python
Date 2014-11-11.01:26:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 =, string)
> if match:
>     process(match)

What happens:
blah = <_sre.SRE_Match object; span=(0, 28), match='<BR>Nov. 10, 08:16:09 PM EST'>
     if blah == True:
     if blah:
            print('blah True')

blah True

Blah is not True

One suggestion: instead, the passage above should say “evaluates true in a boolean context”.
Date User Action Args
2014-11-11 01:26:04crkirkwoodsetrecipients: + crkirkwood, docs@python
2014-11-11 01:26:03crkirkwoodsetmessageid: <>
2014-11-11 01:26:03crkirkwoodlinkissue22843 messages
2014-11-11 01:26:03crkirkwoodcreate