mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
Bug #2565: The repr() of type objects now calls them 'class',
not 'type' - whether they are builtin types or not.
This commit is contained in:
parent
5a6f4585fd
commit
250ad613f3
13 changed files with 40 additions and 43 deletions
|
@ -78,7 +78,7 @@ Also pass another keyword.
|
|||
>>> class C(object, metaclass=M, other="haha"):
|
||||
... pass
|
||||
...
|
||||
Prepare called: ('C', (<type 'object'>,)) {'other': 'haha'}
|
||||
Prepare called: ('C', (<class 'object'>,)) {'other': 'haha'}
|
||||
New called: {'other': 'haha'}
|
||||
>>> C.__class__ is M
|
||||
True
|
||||
|
@ -104,7 +104,7 @@ Use various combinations of explicit keywords and **kwds.
|
|||
>>> kwds = {'metaclass': M, 'other': 'haha'}
|
||||
>>> class C(*bases, **kwds): pass
|
||||
...
|
||||
Prepare called: ('C', (<type 'object'>,)) {'other': 'haha'}
|
||||
Prepare called: ('C', (<class 'object'>,)) {'other': 'haha'}
|
||||
New called: {'other': 'haha'}
|
||||
>>> C.__class__ is M
|
||||
True
|
||||
|
@ -114,7 +114,7 @@ Use various combinations of explicit keywords and **kwds.
|
|||
>>> kwds = {'other': 'haha'}
|
||||
>>> class C(B, metaclass=M, *bases, **kwds): pass
|
||||
...
|
||||
Prepare called: ('C', (<class 'test.test_metaclass.B'>, <type 'object'>)) {'other': 'haha'}
|
||||
Prepare called: ('C', (<class 'test.test_metaclass.B'>, <class 'object'>)) {'other': 'haha'}
|
||||
New called: {'other': 'haha'}
|
||||
>>> C.__class__ is M
|
||||
True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue