A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-February/032993.html below:

[Python-Dev] Why did Fredrik leave the party?

[Python-Dev] Why did Fredrik leave the party? [Python-Dev] Why did Fredrik leave the party?Barry A. Warsaw barry@python.org
Wed, 5 Feb 2003 10:25:16 -0500
>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    GvR> There's also the tension between making the language simpler
    GvR> (to learn) and making programs simpler (to read).  For
    GvR> example, *if* (and that's still a very big if) we were to add
    GvR> a language feature that would let you write

    |     synchronized(lock):
    |         BLOCK

    GvR> instead of

    |     lock.aqcuire()
    |     try:
    |         BLOCK
    |     finally:
    |         lock.release()

The real problem is that the second example isn't even correct, if you
want to be totally anal about it. ;)  You really need an atomic
operation to acquire the lock and enter the try block, which the
second example doesn't give you.  It's a narrow window of failure but
it exists, and you have to decide whether you care.  So the first
example doesn't /just/ improve readability, it improves correctness
too (assuming it is also atomic).

-Barry



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4