mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Change repr() of a new-style class to say <class 'ClassName'> rather
than <type 'ClassName'>. Exception: if it's a built-in type or an extension type, continue to call it <type 'ClassName>. Call me a wimp, but I don't want to break more user code than necessary.
This commit is contained in:
parent
5c294fb0e6
commit
a4cb78874c
3 changed files with 15 additions and 8 deletions
|
|
@ -208,7 +208,7 @@ class foo(object):
|
|||
''')
|
||||
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo
|
||||
eq(repr(foo.foo),
|
||||
"<type 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.foo.foo'>")
|
||||
"<class 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.foo.foo'>")
|
||||
|
||||
def test_object(self):
|
||||
# XXX Test the repr of a type with a really long tp_name but with no
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue