R. David Murray <[email protected]> added the comment:
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).
----------
nosy: +r.david.murray, vinay.sajip
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14868>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com