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/2017-May/147827.html below:

[Python-Dev] Guarantee the success of some object creation C API functions

[Python-Dev] Guarantee the success of some object creation C API functionsChris Angelico rosuav at gmail.com
Mon May 1 17:52:26 EDT 2017
On Tue, May 2, 2017 at 6:52 AM, Terry Reedy <tjreedy at udel.edu> wrote:
> The promise makes it clear that breaking the property is a bug to be fixed.
> It only decreases the probability for someone who has read the promise.
> Unfortunately, 'never fail' is hard to test ;-).
>

Aside from straight-up bugs, how can one of these functions fail? Is
memory allocation failure the only way? If so, the proposed
implementation (private references to pre-created singletons) ought to
guarantee that, to the exact extent that anything else can be
guaranteed.

(Or is that your point - that "never fail" is always "modulo bugs"?)

Incidentally, this guarantee, if implemented the obvious way, will
also mean that (), "", 0, etc are singletons. People talk casually
about the "empty tuple singleton", but I don't think it's actually
guaranteed anywhere.

ChrisA
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