Don't you just love writing this sort of thing :)
steve at REMOVE-THIS-cybersource.com.au
Fri Dec 5 13:15:27 CET 2008
On Fri, 05 Dec 2008 23:16:08 +1300, Lawrence D'Oliveiro wrote:
> In message <0148b086$0$20670$c3e8da3 at news.astraweb.com>, Steven D'Aprano
>> On Fri, 05 Dec 2008 13:27:35 +1300, Lawrence D'Oliveiro wrote:
>>> In message <mailman.4920.1228383577.3487.python-list at python.org>, Cong
>>> Ma wrote:
>>>> The "if ... != None" is not necessary... "if PatchDatePat.search(f)"
>>>> is OK.
>>> I don't do that.
>> Perhaps you should?
> I prefer using explicitly Boolean values for conditions.
Perhaps you do, but there's no evidence of such in your post.
bool(PatchDatePat.search(f) != None)
would be an "explicitly Boolean value". What you posted was an
*implicitly* Boolean value, and not even guaranteed to be Boolean, as
__ne__ can return any object it likes.
And yes, such a call to bool would be pointless.
More information about the Python-list