Author haypo
Recipients HWJ, amaury.forgeotdarc, benjamin.peterson, haypo, pitrou
Date 2008-08-21.14:59:53
SpamBayes Score 4.97263e-11
Marked as misclassified No
Message-id <200808211659.40281.victor.stinner@haypocalc.com>
In-reply-to <1219323369.48ad65e94f011@imp.free.fr>
Content
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 ;-)
History
Date User Action Args
2008-08-21 14:59:55hayposetrecipients: + haypo, amaury.forgeotdarc, pitrou, benjamin.peterson, HWJ
2008-08-21 14:59:54haypolinkissue3187 messages
2008-08-21 14:59:53haypocreate