This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
socket.create_connection(('127.0.0.1', 22)) | |
<socket._socketobject object at 0x9022bc4> | |
s=socket.create_connection(('127.0.0.1', 22)) | |
import gc | |
[ i for i in gc.get_objects() if type(i) == type(s) ] | |
[<socket._socketobject object at 0x9022bc4>, <socket._socketobject object at 0x92a4aac>] | |
t = [ i for i in gc.get_objects() if type(i) == type(s) ][0] | |
t | |
<socket._socketobject object at 0x9022bc4> |
NewerOlder