[Python-Dev] Problems with unicode_literals (original) (raw)
Guido van Rossum guido at python.org
Sat Jan 17 20:25:13 CET 2009
- Previous message: [Python-Dev] Problems with unicode_literals
- Next message: [Python-Dev] Problems with unicode_literals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Jan 17, 2009 at 12:25 AM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
Index: Lib/optparse.py =================================================================== --- Lib/optparse.py (revision 68465) +++ Lib/optparse.py (working copy) @@ -994,7 +994,7 @@ """addoption(Option) addoption(optstr, ..., kwarg=val, ...) """ - if type(args[0]) is types.StringType: + if type(args[0]) in types.StringTypes: option = self.optionclass(*args, **kwargs) elif len(args) == 1 and not kwargs: option = args[0]
Should this be fixed, or wait for 2.7? It would be a new feature. So if we apply a strict policy, it can't be added to 2.6.
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 broken with that mode.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Problems with unicode_literals
- Next message: [Python-Dev] Problems with unicode_literals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]