A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-March/132884.html below:

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

[Python-Dev] unicode_string future, str -> basestring, fix or featureTerry Reedy tjreedy at udel.edu
Sun Mar 2 21:01:01 CET 2014
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)
     Parameters:	name – a string which is a valid shapename

class turtle.Shape(type_, data)
     Parameters:	type_ – one of the strings “polygon”, “image”, “compound”

Suppose adding
from __future__ import unicode_literals
to a working program causes an exception, such as with turtle
http://bugs.python.org/issue15618
(Note: unicode_literals is not indexed.)

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?

-- 
Terry Jan Reedy


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4