comparison contrib/testparseutil.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 cd3b8fd1d3eb
comparison
equal deleted inserted replaced
48945:55d132525155 48946:642e31cb55f0
77 77
78 78
79 #################### 79 ####################
80 80
81 81
82 class embeddedmatcher(object): # pytype: disable=ignored-metaclass 82 class embeddedmatcher: # pytype: disable=ignored-metaclass
83 """Base class to detect embedded code fragments in *.t test script""" 83 """Base class to detect embedded code fragments in *.t test script"""
84 84
85 __metaclass__ = abc.ABCMeta 85 __metaclass__ = abc.ABCMeta
86 86
87 def __init__(self, desc): 87 def __init__(self, desc):
154 Otherwise, this is None 154 Otherwise, this is None
155 :starts: line number (1-origin), at which embedded code starts (inclusive) 155 :starts: line number (1-origin), at which embedded code starts (inclusive)
156 :ends: line number (1-origin), at which embedded code ends (exclusive) 156 :ends: line number (1-origin), at which embedded code ends (exclusive)
157 :code: extracted embedded code, which is single-stringified 157 :code: extracted embedded code, which is single-stringified
158 158
159 >>> class ambigmatcher(object): 159 >>> class ambigmatcher:
160 ... # mock matcher class to examine implementation of 160 ... # mock matcher class to examine implementation of
161 ... # "ambiguous matching" corner case 161 ... # "ambiguous matching" corner case
162 ... def __init__(self, desc, matchfunc): 162 ... def __init__(self, desc, matchfunc):
163 ... self.desc = desc 163 ... self.desc = desc
164 ... self.matchfunc = matchfunc 164 ... self.matchfunc = matchfunc