STINNER Victor <[EMAIL PROTECTED]> added the comment:

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 ;-)

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3187>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to