A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-November/070010.html below:

[Python-Dev] PyFAQ: thread-safe interpreter operations

[Python-Dev] PyFAQ: thread-safe interpreter operations [Python-Dev] PyFAQ: thread-safe interpreter operations"Martin v. Löwis" martin at v.loewis.de
Wed Nov 22 22:49:26 CET 2006
Nick Coghlan schrieb:
> Martin v. Löwis wrote:
>> I personally consider it "good style" to rely on implementation details
>> of CPython;
> 
> Is there a 'do not' missing somewhere in there?

No - I really mean it. I can find nothing wrong with people relying on
reference counting to close files, for example. It's a property of
CPython, and not guaranteed in other Python implementations - yet it
works in a well-defined way in CPython. Code that relies on that feature
is not portable, but portability is only one goal in software
development, and may be irrelevant for some projects.

Likewise, I see nothing wrong with people relying on .append on a list
working "correctly" when used from two threads, even though the language
specification does not guarantee that property.

Similarly, it's fine when people rely on the C type "int" to have
32-bits when used with gcc on x86 Linux. The C standard makes that
implementation-defined, but this specific implementation made a
choice that you can rely on.

Regards,
Martin
More information about the Python-Dev mailing list

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