Message78188
FYI, instead of trying to do exhaustive type checking in _check_type(),
you can just rely on duck typing and catch the TypeError:
>>> str(b"a", "utf-8")
'a'
>>> str(bytearray(b"a"), "utf-8")
'a'
>>> str(memoryview(b"a"), "utf-8")
'a'
>>> str(1, "utf-8")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: coercing to str: need string or buffer, int found |
|
Date |
User |
Action |
Args |
2008-12-22 15:01:36 | pitrou | set | recipients:
+ pitrou, pje, hdima |
2008-12-22 15:01:35 | pitrou | set | messageid: <1229958095.87.0.754259018529.issue4718@psf.upfronthosting.co.za> |
2008-12-22 15:01:35 | pitrou | link | issue4718 messages |
2008-12-22 15:01:34 | pitrou | create | |
|