John Salerno wrote:

> "Joshua Kugler" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> except:
>>    pass
>>
>> is the usual technique there.
> 
> Is there any other?

if 0: 42

Proof:

>>> def cp(pass_):
...     return compile("try: 1/0\nexcept:\n %s" % pass_, "<nofile>", "exec")
...
>>> cp("pass") == cp("if 0: 42")
True

:-)

Peter
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to