Message71647
Le Thursday 21 August 2008 14:55:43 Antoine Pitrou, vous avez écrit :
> > * bytes parent class "class Filename(bytes): ..." -> that's the
> > current implementation
>
> I don't think that makes sense (especially under Windows which has Unicode
> file APIs). os.listdir() and friends should really return str or str-like
> objects, not bytes-like objects with an additional __str__ method.
In we use "class Filename(str): ...", we have to ensure that all operations
takes care of the charset because the unicode version is invalid and not be
used to access to the file system. Dummy example: Filename()+"/" should not
return str but raise an error or create a new filename.
> Well, of course, if we create a filename type, then all os functions must
> be adapted to accept it rather than assume str.
If Filename has no parent class but is convertible to bytes(), os functions
requires no change and so we can fix it before final 3.0 ;-) |
|
Date |
User |
Action |
Args |
2008-08-21 14:59:55 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc, pitrou, benjamin.peterson, HWJ |
2008-08-21 14:59:54 | vstinner | link | issue3187 messages |
2008-08-21 14:59:53 | vstinner | create | |
|