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 r.david.murray
Recipients Lluís, r.david.murray, serhiy.storchaka, vinay.sajip
Date 2012-05-21.11:19:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337599200.4.0.660310427241.issue14868@psf.upfronthosting.co.za>
In-reply-to
Content
I would also, however, not be a typical Python coding pattern.  Functions normally return None by default.  The 'assert....or True' pattern makes it reasonably clear what the intent is, which just having logging return True would not, particularly.  As for efficiency, since your are using the assert to improve the efficiency in -O case, the efficiency in the non -O case becomes less important.

I'm -1 on this suggestion (given that there is an easy way to spell what you want to do).  But we can let Vinay decide :)

There is also another way to spell it, by the way:

   if __debug__: 
       logger.debug('log it')

That is even clearer as to intent.  In fact, I'd be inclined to call that TWOWTDI (The One Obvious Way To Do It).
History
Date User Action Args
2012-05-21 11:20:00r.david.murraysetrecipients: + r.david.murray, vinay.sajip, serhiy.storchaka, Lluís
2012-05-21 11:20:00r.david.murraysetmessageid: <1337599200.4.0.660310427241.issue14868@psf.upfronthosting.co.za>
2012-05-21 11:19:59r.david.murraylinkissue14868 messages
2012-05-21 11:19:59r.david.murraycreate