Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103757

Re: common mistakes in this simple program

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: common mistakes in this simple program
Date 2016-02-29 22:29 +0200
Organization A noiseless patient Spider
Message-ID <878u23cla5.fsf@elektro.pacujo.net> (permalink)
References (1 earlier) <CALwzid=3sN3ic=wrq8qn+0P+Zs8xGn1TJRLYL35B1Qk-vDeh5g@mail.gmail.com> <CACT3xuXn1zCip-io9aQ_i0Av_tR-7AHbwq3bX2HbvdmyC_i9qA@mail.gmail.com> <CALwzidn8-HDrGSqZT2ODxhdNYL7yFt5hdmC8RnB4WC=gkD4Wtg@mail.gmail.com> <mailman.35.1456770105.20602.python-list@python.org> <45787234-afd1-4e45-a34d-3bf4bdc241f1@googlegroups.com>

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: common mistakes in this simple program Ganesh Pal <ganesh1pal@gmail.com> - 2016-02-29 23:51 +0530
  Re: common mistakes in this simple program sohcahtoa82@gmail.com - 2016-02-29 11:23 -0800
    Re: common mistakes in this simple program Marko Rauhamaa <marko@pacujo.net> - 2016-02-29 22:29 +0200

csiph-web