Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jan 17, 2009, at 8:03 AM, Victor Stinner wrote: Le Saturday 17 January 2009 04:45:28 Barry Warsaw, vous avez écrit : The optparse one could easily be fixed for 2.6, if we agree it should be fixed. This untested patch should do it I think: Inde

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Benjamin Peterson
On Sat, Jan 17, 2009 at 4:58 PM, Barry Warsaw wrote: > On Jan 16, 2009, at 10:52 PM, Benjamin Peterson wrote: >> On Fri, Jan 16, 2009 at 9:45 PM, Barry Warsaw wrote: >>> - -if type(args[0]) is types.StringType: >>> +if type(args[0]) in types.StringTypes: >> >> It'd probably be bet

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jan 17, 2009, at 2:25 PM, Guido van Rossum wrote: On Sat, Jan 17, 2009 at 12:25 AM, "Martin v. Löwis" > wrote: Index: Lib/optparse.py === --- Lib/optparse.py(revision 68465) +++

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jan 16, 2009, at 10:52 PM, Benjamin Peterson wrote: On Fri, Jan 16, 2009 at 9:45 PM, Barry Warsaw wrote: The optparse one could easily be fixed for 2.6, if we agree it should be fixed. This untested patch should do it I think: Index: Lib

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Martin v. Löwis
> That seems a bit *too* strict to me, as long as the Unicode strings > contain just ASCII. I'm fine with fixing both cases Barry mentioned, > especially if it otherwise breaks "from __future__ import > unicode_literals". I expect though that as one tries more things one > will find more things bro

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Guido van Rossum
On Sat, Jan 17, 2009 at 12:25 AM, "Martin v. Löwis" wrote: >> Index: Lib/optparse.py >> === >> --- Lib/optparse.py(revision 68465) >> +++ Lib/optparse.py(working copy) >> @@ -994,7 +994,7 @@ >> """add_option(Option) >

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Victor Stinner
Le Saturday 17 January 2009 04:45:28 Barry Warsaw, vous avez écrit : > The optparse one could easily be fixed for 2.6, if we agree it should > be fixed. This untested patch should do it I think: > > Index: Lib/optparse.py > === > ---

Re: [Python-Dev] Problems with unicode_literals

2009-01-17 Thread Martin v. Löwis
> Index: Lib/optparse.py > === > --- Lib/optparse.py(revision 68465) > +++ Lib/optparse.py(working copy) > @@ -994,7 +994,7 @@ > """add_option(Option) > add_option(opt_str, ..., kwarg=val, ...) > "

Re: [Python-Dev] Problems with unicode_literals

2009-01-16 Thread Benjamin Peterson
On Fri, Jan 16, 2009 at 9:45 PM, Barry Warsaw wrote: > > The optparse one could easily be fixed for 2.6, if we agree it should be > fixed. This untested patch should do it I think: > > Index: Lib/optparse.py > === > - --- Lib/optpars

Re: [Python-Dev] Problems with unicode_literals

2009-01-16 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jan 16, 2009, at 10:26 PM, Guido van Rossum wrote: Is the issue that in foo(**{'a': 1, 'b': 1}) the 'a' and 'b' are unicode and not acceptable as keyword arguments? I agree that should be fixed, though I'm not sure it'll be easy. I'm not sure yo

Re: [Python-Dev] Problems with unicode_literals

2009-01-16 Thread Guido van Rossum
Is the issue that in foo(**{'a': 1, 'b': 1}) the 'a' and 'b' are unicode and not acceptable as keyword arguments? I agree that should be fixed, though I'm not sure it'll be easy. I'm not sure you're saying that the optparse case shouldn't be fixed in 2.6. or the foo(**{...}) shouldn't be fixed in