On 6/21/2010 1:29 PM, P.J. Eby wrote:
At 05:49 PM 6/21/2010 +0100, Michael Foord wrote:
Why is your proposed bstr wrapper not practical to implement outside
the core and use in your own libraries and frameworks?

__contains__ doesn't have a converse operation, so you can't code a type
that works around this (Python 3.1 shown):

 >>> from os.path import join
 >>> join(b'x','y')

 >>> join('y',b'x')

I am really unclear what result you intend for such mixed pairs, for all possible mixed pairs, sensible or not. It would seem to me best to write your own pjoin function that did exactly what you want over the whole input domain.

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to