mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Possibly the end of SF [#460020] bug or feature: unicode() and subclasses.
Changed unicode(i) to return a true Unicode object when i is an instance of a unicode subclass. Added PyUnicode_CheckExact macro.
This commit is contained in:
parent
0ebeb584a4
commit
78e0fc74bc
3 changed files with 16 additions and 6 deletions
|
@ -1443,7 +1443,7 @@ def inherits():
|
|||
verify(str(s).__class__ is str)
|
||||
|
||||
s = madstring("\x00" * 5)
|
||||
#XXX verify(str(s) == "\x00" ( 5)
|
||||
#XXX verify(str(s) == "\x00" * 5)
|
||||
verify(str(s).__class__ is str)
|
||||
|
||||
class madunicode(unicode):
|
||||
|
@ -1460,7 +1460,7 @@ def inherits():
|
|||
verify(u.rev().rev() == madunicode(u"ABCDEF"))
|
||||
u = madunicode(u"12345")
|
||||
verify(unicode(u) == u"12345")
|
||||
#XXX verify(unicode(u).__class__ is unicode)
|
||||
verify(unicode(u).__class__ is unicode)
|
||||
|
||||
def all():
|
||||
lists()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue