[Python-checkins] python/nondist/peps pep-0349.txt,1.1,1.2
nascheme@users.sourceforge.net
nascheme at users.sourceforge.net
Sat Aug 6 06:05:51 CEST 2005
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16556
Modified Files:
pep-0349.txt
Log Message:
Mention %s change in abstract. Fix bug in code (found by Osvaldo Santana
Neto).
Index: pep-0349.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0349.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pep-0349.txt 5 Aug 2005 02:59:00 -0000 1.1
+++ pep-0349.txt 6 Aug 2005 04:05:48 -0000 1.2
@@ -15,9 +15,12 @@
This PEP proposes the introduction of a new built-in function,
text(), that provides a way of generating a string representation
- of an object. This function would make it easier to write library
- code that processes string data without forcing the use of a
- particular string type.
+ of an object without forcing the result to be a particular string
+ type. In addition, the behavior %s format specifier would be
+ changed to call text() on the argument. These two changes would
+ make it easier to write library code that can be used by
+ applications that use only the str type and by others that also use
+ the unicode type.
Rationale
@@ -90,7 +93,7 @@
if isinstance(s, basestring):
return s
r = s.__str__()
- if not isinstance(s, basestring):
+ if not isinstance(r, basestring):
raise TypeError('__str__ returned non-string')
return r
More information about the Python-checkins
mailing list