I've noticed something odd in Python 2.5, namely that the 2 argument
version of 'assert' is broken. Or at least it seems that way to me.
Run the following code in your Python interpreter:
myString = None
assert( myString, 'The string is either empty or set to the None type!'
)
assert( myString
On 6 Dec 2006 06:34:49 -0800, antred [EMAIL PROTECTED] wrote:
I've noticed something odd in Python 2.5, namely that the 2 argument
version of 'assert' is broken. Or at least it seems that way to me.
Run the following code in your Python interpreter:
myString = None
assert( myString, 'The string
Never mind, I'm a schmuck!! =0
It should have been
assert myString, 'String empty or None!'
Sorry, ignore me. =\
--
http://mail.python.org/mailman/listinfo/python-list
antred a écrit :
I've noticed something odd in Python 2.5, namely that the 2 argument
version of 'assert' is broken. Or at least it seems that way to me.
Run the following code in your Python interpreter:
myString = None
assert( myString, 'The string is either empty or set to the None
In [EMAIL PROTECTED], antred wrote:
Run the following code in your Python interpreter:
myString = None
assert( myString, 'The string is either empty or set to the None type!'
)
assert( myString )
You'll notice that the first assert doesn't do anything, whereas the
second assert
antred wrote:
I've noticed something odd in Python 2.5, namely that the 2 argument
version of 'assert' is broken. Or at least it seems that way to me.
Run the following code in your Python interpreter:
myString = None
assert( myString, 'The string is either empty or set to the None
antred a écrit :
I've noticed something odd in Python 2.5, namely that the 2 argument
version of 'assert' is broken. Or at least it seems that way to me.
Run the following code in your Python interpreter:
myString = None
assert( myString, 'The string is either empty or set to the None
Yeah, it hit me seconds after I had posted my message. =0 Why didn't I
think of it during the 30 minutes I spent banging my head against the
keyboard going nuts over this 'bug' ...
--
http://mail.python.org/mailman/listinfo/python-list
The reason why it won't raise the AssertionError is because the
condition in the assert statement is a non-empty tuple, and its boolean
value would be True, not False, which is required to raise an assertion
error.
antred wrote:
Yeah, it hit me seconds after I had posted my message. =0 Why
antred [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Yeah, it hit me seconds after I had posted my message. =0 Why didn't I
think of it during the 30 minutes I spent banging my head against the
keyboard going nuts over this 'bug' ...
Because communication brings consciousness ;-)
At Wednesday 6/12/2006 11:46, antred wrote:
Yeah, it hit me seconds after I had posted my message. =0 Why didn't I
think of it during the 30 minutes I spent banging my head against the
keyboard going nuts over this 'bug' ...
The same reason you can sometimes find what's wrong just by
On 2006-12-07, Gabriel Genellina [EMAIL PROTECTED] wrote:
Yeah, it hit me seconds after I had posted my message. =0 Why
didn't I think of it during the 30 minutes I spent banging my
head against the keyboard going nuts over this 'bug' ...
The same reason you can sometimes find what's wrong just
Neil Cerutti [EMAIL PROTECTED] writes:
On 2006-12-07, Gabriel Genellina [EMAIL PROTECTED] wrote:
The same reason you can sometimes find what's wrong just by
explaining the symptoms to another guy... Having to put things
sorted and simple to understand by another, just makes you think
13 matches
Mail list logo