Paul Rubin wrote:
> bruno at modulix <[EMAIL PROTECTED]> writes:
>
>>What's wrong with:
>>
>>assert foo and bar and i > 10, \
>> "if foo and bar i must not be greater than 10"
>
>
> It doesn't necessarily do anything. With optimization enable, assert
> is a no-op.
quoting the OP (emphasis is
bruno at modulix <[EMAIL PROTECTED]> writes:
> What's wrong with:
>
> assert foo and bar and i > 10, \
> "if foo and bar i must not be greater than 10"
It doesn't necessarily do anything. With optimization enable, assert
is a no-op.
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Guettler <[EMAIL PROTECTED]> writes:
> I like python because it is compatible to old versions.
I like it because it has a documented, manageable procedure for
breaking compatibility with old versions.
> if foo and bar and i>10:
> raise "if foo and bar i must not be greater than 10"
O
"Thomas Guettler" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I like python because it is compatible to old versions.
Python 3 will be a new and mostly improved dialect of Python.
Some 2.x code will run unchanged. Much will not. Transition tools will be
written.
> That's way
bruno at modulix wrote:
> Thomas Guettler wrote:
>
>>Hi,
>>
>>I like python because it is compatible to old versions. That's way I think
>>string exceptions should not be deprecated.
>>
>>I use string exceptions if the condition for an assertion is
>>to complex:
>>
>>if foo and bar and i>10:
>>
Thomas Guettler wrote:
> Hi,
>
> I like python because it is compatible to old versions. That's way I think
> string exceptions should not be deprecated.
>
> I use string exceptions if the condition for an assertion is
> to complex:
>
> if foo and bar and i>10:
> raise "if foo and bar i must
You could also use the "assert" statement:
>>> if foo and bar:
... assert i <= 10, "if foo and bar then i must not be greater than
10"
...
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I like python because it is compatible to old versions. That's way I think
string exceptions should not be deprecated.
I use string exceptions if the condition for an assertion is
to complex:
if foo and bar and i>10:
raise "if foo and bar i must not be greater than 10"
This way I can e