| Store | Cart

Re: [Python-Dev] [PEP466] SSLSockets, and sockets, _socketobjects oh my!

From: Antoine Pitrou <anto...@python.org>
Tue, 22 Jul 2014 17:25:27 -0400
Le 22/07/2014 17:03, Alex Gaynor a écrit :
>> The question is:>> a) Should we backport weak referencing _socket.sockets (changing the structure>     of the module seems overly invasive, albeit completely backwards>     compatible)?> b) Does anyone know why weak references are used in the first place? The commit>     message just alludes to fixing a leak with no reference to an issue.
Because :
- the SSLSocket has a strong reference to the ssl object (self._sslobj)
- self._sslobj having a strong reference to the SSLSocket would mean 
both would only get destroyed on a GC collection

I assume that's what "leak" means here :-)

As for 2.x, I don't see why you couldn't just continue using a strong 
reference.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com
Recent Messages in this Thread
Alex Gaynor Jul 22, 2014 09:03 pm
Antoine Pitrou Jul 22, 2014 09:25 pm
Nick Coghlan Jul 22, 2014 09:44 pm
Antoine Pitrou Jul 22, 2014 11:00 pm
Alex Gaynor Jul 23, 2014 07:36 pm
Antoine Pitrou Jul 23, 2014 09:02 pm
Alex Gaynor Jul 23, 2014 09:10 pm
Nick Coghlan Jul 23, 2014 10:06 pm
Messages in this thread