@@ -37,16 +37,16 @@ def merge(self, other):
3737Here's the new type at work:
3838
3939 >>> print(defaultdict) # show our type
40- <class 'test.test_descrtut.defaultdict' ... >
40+ <class 'test.test_descrtut.defaultdict'>
4141 >>> print(type(defaultdict)) # its metatype
42- <class 'type' ... >
42+ <class 'type'>
4343 >>> a = defaultdict(default=0.0) # create an instance
4444 >>> print(a) # show the instance
4545 {}
4646 >>> print(type(a)) # show its type
47- <class 'test.test_descrtut.defaultdict' ... >
47+ <class 'test.test_descrtut.defaultdict'>
4848 >>> print(a.__class__) # show its class
49- <class 'test.test_descrtut.defaultdict' ... >
49+ <class 'test.test_descrtut.defaultdict'>
5050 >>> print(type(a) is a.__class__) # its type is its class
5151 True
5252 >>> a[1] = 3.25 # modify the instance
@@ -149,11 +149,11 @@ def merge(self, other):
149149For instance of built-in types, x.__class__ is now the same as type(x):
150150
151151 >>> type([])
152- <class 'list' ... >
152+ <class 'list'>
153153 >>> [].__class__
154- <class 'list' ... >
154+ <class 'list'>
155155 >>> list
156- <class 'list' ... >
156+ <class 'list'>
157157 >>> isinstance([], list)
158158 True
159159 >>> isinstance([], dict)
@@ -258,19 +258,19 @@ def merge(self, other):
258258 ... print("classmethod", cls, y)
259259
260260 >>> C.foo(1)
261- classmethod <class 'test.test_descrtut.C' ... > 1
261+ classmethod <class 'test.test_descrtut.C'> 1
262262 >>> c = C()
263263 >>> c.foo(1)
264- classmethod <class 'test.test_descrtut.C' ... > 1
264+ classmethod <class 'test.test_descrtut.C'> 1
265265
266266 >>> class D(C):
267267 ... pass
268268
269269 >>> D.foo(1)
270- classmethod <class 'test.test_descrtut.D' ... > 1
270+ classmethod <class 'test.test_descrtut.D'> 1
271271 >>> d = D()
272272 >>> d.foo(1)
273- classmethod <class 'test.test_descrtut.D' ... > 1
273+ classmethod <class 'test.test_descrtut.D'> 1
274274
275275This prints "classmethod __main__.D 1" both times; in other words, the
276276class passed as the first argument of foo() is the class involved in the
@@ -286,11 +286,11 @@ class passed as the first argument of foo() is the class involved in the
286286
287287 >>> E.foo(1)
288288 E.foo() called
289- classmethod <class 'test.test_descrtut.C' ... > 1
289+ classmethod <class 'test.test_descrtut.C'> 1
290290 >>> e = E()
291291 >>> e.foo(1)
292292 E.foo() called
293- classmethod <class 'test.test_descrtut.C' ... > 1
293+ classmethod <class 'test.test_descrtut.C'> 1
294294
295295In this example, the call to C.foo() from E.foo() will see class C as its
296296first argument, not class E. This is to be expected, since the call
@@ -350,7 +350,7 @@ class passed as the first argument of foo() is the class involved in the
350350
351351 >>> del property # unmask the builtin
352352 >>> property
353- <class 'property' ... >
353+ <class 'property'>
354354
355355 >>> class C(object):
356356 ... def __init__(self):
@@ -478,8 +478,7 @@ def test_main(verbose=None):
478478 # business is used the name can change depending on how the test is
479479 # invoked.
480480 from test import support , test_descrtut
481- import doctest
482- support .run_doctest (test_descrtut , verbose , optionflags = doctest .ELLIPSIS )
481+ support .run_doctest (test_descrtut , verbose )
483482
484483# This part isn't needed for regrtest, but for running the test directly.
485484if __name__ == "__main__" :
0 commit comments