[Python-Dev] [PEP466] SSLSockets, and sockets, _socketobjects oh my! (original) (raw)
Antoine Pitrou antoine at python.org
Tue Jul 22 23:25:27 CEST 2014
- Previous message: [Python-Dev] [PEP466] SSLSockets, and sockets, _socketobjects oh my!
- Next message: [Python-Dev] [PEP466] SSLSockets, and sockets, _socketobjects oh my!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message: [Python-Dev] [PEP466] SSLSockets, and sockets, _socketobjects oh my!
- Next message: [Python-Dev] [PEP466] SSLSockets, and sockets, _socketobjects oh my!
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]