Message78188
| Author |
pitrou |
| Recipients |
hdima, pitrou, pje |
| Date |
2008年12月22日.15:01:34 |
| SpamBayes Score |
2.7627782e-06 |
| Marked as misclassified |
No |
| Message-id |
<1229958095.87.0.754259018529.issue4718@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|
History
|
|---|
| 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 |
|