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/2016-October/146638.html below:

[Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

[Python-Dev] PyWeakref_GetObject() borrows its reference from... whom? [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?Greg Ewing greg.ewing at canterbury.ac.nz
Mon Oct 10 18:22:42 EDT 2016
> On Tue, Oct 11, 2016 at 4:03 AM, Paul Moore <p.f.moore at gmail.com> wrote:
> 
>> If you have an object that forever owns a reference to
>> another object, it's safe to return borrowed references.

Even if there are such cases, it seems we're going to
have to be a lot more careful about identifying them.

It might be safer not to have any APIs that return
borrowed references, or at least name them in a way
that make it clear they're dangerous and only to be
used with extreme care.

Having things like PyDict_GetItem where the *normal*
version of the API returns a borrowed reference seems
like a footgun.

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