[issue18642] enhancement for operator 'assert'

Al Korgun report at bugs.python.org
Sat Aug 3 20:45:09 CEST 2013


Al Korgun added the comment:

Mark Dickinson, #1 if dedug (and type check, respectively, as in this example, and 'raise') isn't needed we just need pyo
>> Python won't execute those asserts at all
that is convenient.

if not isinstance(data, basestring):
    raise TypeError(...)

- here we need additionally check debug variable, use wrapper or something.
#2 'assert' is a good breakpoint (sorry, bad english. not sure if this is what I wanted to say) on its own. And to orientate on check & 'raise' we have to mark it somehow.
#3 Well, the code is shorter, obviously.

R. David Murray, yes, maybe confusing, but I can imagine many ways when it is very convenient.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18642>
_______________________________________


More information about the Python-bugs-list mailing list