Mercurial > hg
comparison tests/test-extensions-wrapfunction.py @ 48946:642e31cb55f0
py3: use class X: instead of class X(object):
The inheritance from object is implied in Python 3. So this should
be equivalent.
This change was generated via an automated search and replace. So there
may have been some accidental changes.
Differential Revision: https://phab.mercurial-scm.org/D12352
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 21 Feb 2022 13:08:28 -0700 |
parents | 6000f5b25c9b |
children | 493034cc3265 |
comparison
equal
deleted
inserted
replaced
48945:55d132525155 | 48946:642e31cb55f0 |
---|---|
14 | 14 |
15 | 15 |
16 wrappers = [genwrapper(i) for i in range(5)] | 16 wrappers = [genwrapper(i) for i in range(5)] |
17 | 17 |
18 | 18 |
19 class dummyclass(object): | 19 class dummyclass: |
20 def getstack(self): | 20 def getstack(self): |
21 return ['orig'] | 21 return ['orig'] |
22 | 22 |
23 | 23 |
24 dummy = dummyclass() | 24 dummy = dummyclass() |
65 print('context manager', dummy.getstack()) | 65 print('context manager', dummy.getstack()) |
66 print('context manager', dummy.getstack()) | 66 print('context manager', dummy.getstack()) |
67 print('context manager', dummy.getstack()) | 67 print('context manager', dummy.getstack()) |
68 | 68 |
69 # Wrap callable object which has no __name__ | 69 # Wrap callable object which has no __name__ |
70 class callableobj(object): | 70 class callableobj: |
71 def __call__(self): | 71 def __call__(self): |
72 return ['orig'] | 72 return ['orig'] |
73 | 73 |
74 | 74 |
75 dummy.cobj = callableobj() | 75 dummy.cobj = callableobj() |