Message74242
| Author |
pitrou |
| Recipients |
HWJ, amaury.forgeotdarc, bboissin, benjamin.peterson, djc, dlitz, draghuram, gvanrossum, loewis, pitrou, vstinner, zegreek |
| Date |
2008年10月03日.11:52:55 |
| SpamBayes Score |
7.679157e-11 |
| Marked as misclassified |
No |
| Message-id |
<1223034773.23259.4.camel@fsol> |
| In-reply-to |
<200810031344.06702.victor.stinner@haypocalc.com> |
| Content |
Le vendredi 03 octobre 2008 à 11:43 +0000, STINNER Victor a écrit :
> STINNER Victor <victor.stinner@haypocalc.com> added the comment:
>
> > The most generic way of allowing all bytes-alike objects is to write:
> > path = bytes(path)
>
> If you use that, any unicode may fails and the function will always return
> unicode. The goal is to get:
> func(bytes)->bytes
> func(bytearray)->bytes (or maybe bytearray, it doesn't matter)
> func(unicode)->unicode
Then make it:
path = path if isinstance(path, str) else bytes(path) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年10月03日 11:53:00 | pitrou | set | recipients:
+ pitrou, gvanrossum, loewis, amaury.forgeotdarc, vstinner, draghuram, benjamin.peterson, djc, HWJ, dlitz, zegreek, bboissin |
| 2008年10月03日 11:52:56 | pitrou | link | issue3187 messages |
| 2008年10月03日 11:52:56 | pitrou | create |
|