Re: [Python-Dev] Explicitly declaring expected exceptions for a block

2005-06-21 Thread Dmitry Dvoinikov
t: print exc_info() -- still yields exceptions.TypeError. Now, back to original question then, do you think it'd be beneficial to have some sort of exception ignoring or expecting statement ? Sincerely, Dmitry Dvoinikov http://www.targeted.org/ --- Original message follows ---

Re: [Python-Dev] Explicitly declaring expected exceptions for ablock

2005-06-21 Thread Dmitry Dvoinikov
Error: c().foo() and still can be implemented under PEP 343, that's what I meant under "more flexible". Sincerely, Dmitry Dvoinikov http://www.targeted.org/ --- Original message follows --- >> I suspect that you wanted either: >>try: >>c().foo(

Re: [Python-Dev] Explicitly declaring expected exceptions for ablock

2005-06-21 Thread Dmitry Dvoinikov
se: assert False, "c.foo() should have thrown TypeError" and so if foo throws anything but TypeError I get traceback, otherwise it's an assertion error and is reported as such. This is probably just one of the many possible wording of the same thing though. Sincerely, Dmitry Dvoin

Re: [Python-Dev] Explicitly declaring expected exceptions for a block

2005-06-20 Thread Dmitry Dvoinikov
> If you're trying to write tests, perhaps a better use-case would be > something like: > with required_exception(SomeError): > do something that should cause SomeError Yes, you are right, that'd be a better and more flexible way, thank you. Sincerely,

[Python-Dev] Explicitly declaring expected exceptions for a block

2005-06-20 Thread Dmitry Dvoinikov
h could be written as ignore TypeError: c().foo() Sincerely, Dmitry Dvoinikov http://www.targeted.org/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/opti

Re: [Python-Dev] Wishlist: dowhile

2005-06-13 Thread Dmitry Dvoinikov
is still a bit unpleasant: --- do: body while Cond: # no else here ------- Sincerely, Dmitry Dvoinikov http://www.targeted.org/ --- Original message follows --- > [BJörn Lindqvist] >> I would like to have do-while's like this: >> >>