[Python-checkins] CVS: python/dist/src/Lib/test test_descrtut.py,1.6,1.7 test_repr.py,1.7,1.8
Guido van Rossum
gvanrossum@users.sourceforge.net
Mon, 24 Sep 2001 20:56:31 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv9052/Lib/test
Modified Files:
test_descrtut.py test_repr.py
Log Message:
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.
Index: test_descrtut.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descrtut.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** test_descrtut.py 2001/09/21 19:29:08 1.6
--- test_descrtut.py 2001/09/25 03:56:29 1.7
***************
*** 38,42 ****
>>> print defaultdict # show our type
! <type 'test.test_descrtut.defaultdict'>
>>> print type(defaultdict) # its metatype
<type 'type'>
--- 38,42 ----
>>> print defaultdict # show our type
! <class 'test.test_descrtut.defaultdict'>
>>> print type(defaultdict) # its metatype
<type 'type'>
***************
*** 45,51 ****
{}
>>> print type(a) # show its type
! <type 'test.test_descrtut.defaultdict'>
>>> print a.__class__ # show its class
! <type 'test.test_descrtut.defaultdict'>
>>> print type(a) is a.__class__ # its type is its class
1
--- 45,51 ----
{}
>>> print type(a) # show its type
! <class 'test.test_descrtut.defaultdict'>
>>> print a.__class__ # show its class
! <class 'test.test_descrtut.defaultdict'>
>>> print type(a) is a.__class__ # its type is its class
1
Index: test_repr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_repr.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** test_repr.py 2001/09/20 21:33:42 1.7
--- test_repr.py 2001/09/25 03:56:29 1.8
***************
*** 209,213 ****
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo
eq(repr(foo.foo),
! "<type 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.foo.foo'>")
def test_object(self):
--- 209,213 ----
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo
eq(repr(foo.foo),
! "<class 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.foo.foo'>")
def test_object(self):