Re: String Exceptions (PEP 352)

2006-05-05 Thread bruno at modulix
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

Re: String Exceptions (PEP 352)

2006-04-29 Thread Paul Rubin
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

Re: String Exceptions (PEP 352)

2006-04-27 Thread Ben Finney
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

Re: String Exceptions (PEP 352)

2006-04-27 Thread Terry Reedy
"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

Re: String Exceptions (PEP 352)

2006-04-27 Thread bruno at modulix
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: >>

Re: String Exceptions (PEP 352)

2006-04-27 Thread bruno at modulix
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

Re: String Exceptions (PEP 352)

2006-04-27 Thread infidel
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

String Exceptions (PEP 352)

2006-04-27 Thread Thomas Guettler
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