Xuanji Li <xua...@gmail.com> added the comment: So, reading all your comments, I gather that my proposed patch for client.py which is
try: self.sock.sendall(data) except TypeError: if isinstance(data, collections.Iterable): for d in t: self.sock.sendall(d) else: raise TypeError("data should be a bytes-like object or an iterable, got %r" % type(it)) is ok, because it avoids using hasattr to test for Iterable and avoids isinstance() to check for specific types (str, bytes...) but instead uses exceptions (as pitrou suggested)? if that is ok with everyone, I just need to work more on request.py to remove the hasattr; I'll probably use the memoryview solution suggested by pitrou. just to confirm: we WANT array.array("I", [1,2,3]) to have a content-length of 12, right? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3243> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com