[Python-3000-checkins] r56559 - python/branches/py3k-struni/Lib/io.py

guido.van.rossum python-3000-checkins at python.org
Fri Jul 27 06:38:25 CEST 2007


Author: guido.van.rossum
Date: Fri Jul 27 06:38:24 2007
New Revision: 56559

Modified:
   python/branches/py3k-struni/Lib/io.py
Log:
Delete redundant read() and close() methods from SocketIO class.


Modified: python/branches/py3k-struni/Lib/io.py
==============================================================================
--- python/branches/py3k-struni/Lib/io.py	(original)
+++ python/branches/py3k-struni/Lib/io.py	Fri Jul 27 06:38:24 2007
@@ -457,33 +457,9 @@
     def readinto(self, b):
         return self._sock.recv_into(b)
 
-    def read(self, n: int = None) -> bytes:
-        """read(n: int) -> bytes.  Read and return up to n bytes.
-
-        Returns an empty bytes array on EOF, or None if the object is
-        set not to block and has no data to read.
-        """
-        if n is None:
-            n = -1
-        if n >= 0:
-            return RawIOBase.read(self, n)
-        # Support reading until the end.
-        # XXX Why doesn't RawIOBase support this?
-        data = b""
-        while True:
-            more = RawIOBase.read(self, DEFAULT_BUFFER_SIZE)
-            if not more:
-                break
-            data += more
-        return data
-
     def write(self, b):
         return self._sock.send(b)
 
-    def close(self):
-        if not self.closed:
-            RawIOBase.close(self)
-
     def readable(self):
         return "r" in self._mode
 


More information about the Python-3000-checkins mailing list