Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-04 Thread Stephen J. Turnbull
Guido van Rossum writes: Given that the claim Python 2 doesn't support Unicode filenames is factually incorrect (in Python 2.7, most filesystem calls in fact do support Unicode, at least on some platforms), I don't understand what support Unicode means. Just that with open(u\u4e00,

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-04 Thread Guido van Rossum
On Tue, Mar 4, 2014 at 5:23 AM, Stephen J. Turnbull step...@xemacs.orgwrote: Guido van Rossum writes: Given that the claim Python 2 doesn't support Unicode filenames is factually incorrect (in Python 2.7, most filesystem calls in fact do support Unicode, at least on some platforms),

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-03 Thread Chris Barker
On Sun, Mar 2, 2014 at 6:44 PM, Guido van Rossum gu...@python.org wrote: AFACT, in that message Victor was only talking about allowing Unicode filenames. ... Finally, in most places Python 2.7 *does* handle Unicode filenames just fine. I'm a bit confused. In this example:

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-03 Thread Guido van Rossum
On Mon, Mar 3, 2014 at 8:37 AM, Chris Barker chris.bar...@noaa.gov wrote: On Sun, Mar 2, 2014 at 6:44 PM, Guido van Rossum gu...@python.org wrote: AFACT, in that message Victor was only talking about allowing Unicode filenames. ... Finally, in most places Python 2.7 *does* handle Unicode

[Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Terry Reedy
Suppose a 2.7 standard library function is documented as taking a 'string' argument, such as these examples from the turtle module. pencolor(colorstring) Set pencolor to colorstring, which is a Tk color specification string, such as red, yellow, or #33cc8c. turtle.shape(name=None)

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Antoine Pitrou
On Sun, 02 Mar 2014 15:01:01 -0500 Terry Reedy tjre...@udel.edu wrote: Suppose a 2.7 standard library function is documented as taking a 'string' argument, such as these examples from the turtle module. pencolor(colorstring) Set pencolor to colorstring, which is a Tk color

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Guido van Rossum
It looks to me like a defect in the library (*), and you are making a reasonable argument that we should fix it in 2.7 to help people be more prepared for the transition to Python 3. (*) As Antoine points out, pretty much the only time where it's not a good idea to switch from str to basestring

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Terry Reedy
On 3/2/2014 3:12 PM, Guido van Rossum wrote: It looks to me like a defect in the library (*), and you are making a reasonable argument that we should fix it in 2.7 to help people be more prepared for the transition to Python 3. (*) As Antoine points out, pretty much the only time where it's not

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Serhiy Storchaka
02.03.14 22:01, Terry Reedy написав(ла): Is this a programmer error for passing unicode instead of string, or a library error for not accepting unicode? Is changing 'isinstance(x, str)' in the library (with whatever other changes are needed) a bugfix to be pushed or a prohibited API expansion?

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Berker Peksağ
On Sun, Mar 2, 2014 at 11:23 PM, Serhiy Storchaka storch...@gmail.com wrote: Patches which add support for unicode strings were accepted for one issues (e.g. http://bugs.python.org/issue19099) and rejected for other issues (e.g. http://bugs.python.org/issue20014 and

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Terry Reedy
On 3/2/2014 4:23 PM, Serhiy Storchaka wrote: 02.03.14 22:01, Terry Reedy написав(ла): Is this a programmer error for passing unicode instead of string, or a library error for not accepting unicode? Is changing 'isinstance(x, str)' in the library (with whatever other changes are needed) a bugfix

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Nick Coghlan
On 3 March 2014 10:02, Terry Reedy tjre...@udel.edu wrote: On 3/2/2014 4:23 PM, Serhiy Storchaka wrote: 02.03.14 22:01, Terry Reedy написав(ла): Is this a programmer error for passing unicode instead of string, or a library error for not accepting unicode? Is changing 'isinstance(x, str)'

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Stephen J. Turnbull
Terry Reedy writes: On 3/2/2014 4:23 PM, Serhiy Storchaka wrote: Patches which add support for unicode strings were accepted for one issues (e.g. http://bugs.python.org/issue19099) and rejected for other issues (e.g. http://bugs.python.org/issue20014 and

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Guido van Rossum
AFACT, in that message Victor was only talking about allowing Unicode filenames. Making everything polymorphic is clearly pulling on the thread that will unravel the entire sweater. But... The start of this thread was about changing a few occurrences of isinstance(..., str) to use basestring,

Re: [Python-Dev] unicode_string future, str - basestring, fix or feature

2014-03-02 Thread Serhiy Storchaka
03.03.14 02:02, Terry Reedy написав(ла): On 3/2/2014 4:23 PM, Serhiy Storchaka wrote: 02.03.14 22:01, Terry Reedy написав(ла): Is this a programmer error for passing unicode instead of string, or a library error for not accepting unicode? Is changing 'isinstance(x, str)' in the library (with