◐ Shell
clean mode source ↗

Message 60386 - Python tracker

Logged In: YES 
user_id=832557

Two other comments on socket.close() in Python 2.3.

In addition, the socket.close() method in the Lib/socket.py
class does not even call the _realsocket.close() method.

Before zapping the _sock attribute, shouldn't the latter
close() method be called first?  If not, what happens to
any data which may be buffered by the _realsocket?


Also, every time the socket.close() method is called
another, new instance of the _closedsocket class is
created.  That seems unnecessary waste.

Why not use a single instance created once at the
module level?