Gregory P. Smith <g...@krypto.org> added the comment: from #python-dev discussion.
agreed, magic attributes are annoying. also, my gps05 patch continues to return the old fileno even after the underlying socket has been closed. that is a problem. I like your patch in #4791 but lets keep both sets of our unit tests. Also, I think the SocketIO.fileno mathod should change to: def fileno(self): no = self._sock.fileno() if no == -1: raise IOError("no file descriptor, socket is closed.") io.IOBase.fileno already raises IOError when no file descriptor is associated with a file so this behavior seems reasonable and more pythonic than returning a magic -1. thoughts? _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3826> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com