On Tue, Oct 11, 2016 at 4:03 AM, Paul Moore <p.f.mo...@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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com