Is it possible to create an object from the represented text of python objects when they are represented on the screen?
>>> select.select([s], [],[])
([<socket._socketobject object at 0x7f274914c600>], [], [])
>>> eval('<socket._socketobject object at 0x7f274914c600>') # Fail
Or once the object is represented to stdout, does it get GCd?
Not of significant use, but when playing with the Python CLI, it might be occasionally helpful.
The output of
reprmay be able to reconstruct the object, however the convention is, if it has bits surrounded by angle brackets then those bits aren’t reconstructible.So in this case you can’t reconstruct the socket, and yes it will be garbage collected straight away.