Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: common mistakes in this simple program Date: Mon, 29 Feb 2016 22:29:54 +0200 Organization: A noiseless patient Spider Lines: 26 Message-ID: <878u23cla5.fsf@elektro.pacujo.net> References: <45787234-afd1-4e45-a34d-3bf4bdc241f1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="24981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WKO/WRxCbnz7vW2Motdsz" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:JLjh8yyyYFYoEkKW55EpSOjoZSw= sha1:LchClmK87bRT6/bfD850ihepVv0= Xref: csiph.com comp.lang.python:103757 sohcahtoa82@gmail.com: > Every time you say "try-expect", my head wants to explode. > > It is called a "try-except" block, because you're using the key words > "try" and "except" when you make one. Ah, I remember a Python-based test system idea where the "except" keyword meant "expect": try: event() except user.CloseRequest(): ... except user.SendRequest(): ... except peer.DataIndication(): ... except Timeout(): ... etc. In the end, though, we came up with something better. Marko