➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 xuanji
收信人 catlee, davide.rizzo, eric.araujo, georg.brandl, jhylton, orsenthil, pitrou, rcoyner, rhettinger, xuanji
日期 2010-12-01.01:59:53
SpamBayes Score 2.0584379e-08
Marked as misclassified 否
Message-id <1291168798.38.0.857792504711.issue3243@psf.upfronthosting.co.za>
In-reply-to
内容
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?
历史
日期 用户 动作 参数
2010-12-01 01:59:58xuanji修改recipients: + xuanji, jhylton, georg.brandl, rhettinger, orsenthil, pitrou, catlee, eric.araujo, rcoyner, davide.rizzo
2010-12-01 01:59:58xuanji修改messageid: <1291168798.38.0.857792504711.issue3243@psf.upfronthosting.co.za>
2010-12-01 01:59:53xuanji链接issue3243 messages
2010-12-01 01:59:53xuanji创建