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/2014-June/134838.html below:

[Python-Dev] [numpy wishlist] Interpreter support for temporary elision in third-party classes

[Python-Dev] [numpy wishlist] Interpreter support for temporary elision in third-party classes [Python-Dev] [numpy wishlist] Interpreter support for temporary elision in third-party classesGreg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 6 04:17:20 CEST 2014
Nathaniel Smith wrote:
> I.e., BIN_ADD could do
> 
> if (Py_REFCNT(left) == 1)
>     result = PyNumber_InPlaceAdd(left, right);
> else
>     result = PyNumber_Add(left, right)
> 
> Upside: all packages automagically benefit!
> 
> Potential downsides to consider:
> - Subtle but real and user-visible change in Python semantics.

That would be a real worry. Even if such cases were rare,
they'd be damnably difficult to debug when they did occur.

I think for safety's sake this should only be done if the
type concerned opts in somehow, perhaps by a tp_flag
indicating that the type is eligible for temporary
elision.

-- 
Greg
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