[Python-bugs-list] [ python-Bugs-448144 ] incompatible change of string type name
noreply@sourceforge.net
noreply@sourceforge.net
Tue, 07 Aug 2001 06:47:47 -0700
Bugs item #448144, was opened at 2001-08-05 05:43
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448144&group_id=5470
>Category: type/class unification
>Group: Python 2.2
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Guido van Rossum (gvanrossum)
Summary: incompatible change of string type name
Initial Comment:
In Python 2.1 and earlier, type("").__name__ was
"string". In 2.2a1, it is "str". This change breaks
the xml.marshal package of PyXML, which uses the type
name to generate a method m_string. Since there is no
m_str method implemented, running the marshaller
under 2.2 fails.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2001-08-06 23:10
Message:
Logged In: YES
user_id=21627
Assigning m_str from m_string is indeed what I did for
PyXML 0.6.6. Yet, I was displeased that it broke in the
first place.
I'd accept if you close this report with "Won't fix" -
I just wanted to report the problem, and perhaps ask for
somebody to produce a list of incompatible changes in 2.2.
----------------------------------------------------------------------
Comment By: Tim Peters (tim_one)
Date: 2001-08-06 14:17
Message:
Logged In: YES
user_id=31435
Note that the name "long int" also changed to "long". The
std repr.py was affected by this (and by string->str) too.
It was no bother to change it in repr.py, I expect the
point is more (a) possibly silent breakage (repr.py didn't
know it was broken), and (b) writing code that works under
all versions of Python.
WRT the latter, I bet Martin would be done if he just adds a
m_str = m_string
line to the affected class(es).
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-08-06 11:47
Message:
Logged In: YES
user_id=6380
Hm. If I change the type's name back to 'string', the
built-in name for it has to be 'string' (otherwise some part
of marshal or pickle won't work). But I had hoped to use the
'string' built-in name for the base class of str and
unicode.
Is it terribly inconvenient to have to rename the m_string
function to m_str?
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448144&group_id=5470