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 wrote: > > 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

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 ope

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 wrote: > On Sun, Mar 2, 2014 at 6:44 PM, Guido van Rossum 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. >

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 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: http://bugs.python.org/iss

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 wh

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, and

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 > > http://bugs.python.o

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 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)' i

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 Berker Peksağ
On Sun, Mar 2, 2014 at 11: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 http://bugs.python.org/issue20015). See also

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 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 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 is

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 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 specification > string,

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