@@ -156,19 +156,23 @@ class MergeError(ValueError):
156
156
157
157
158
158
class AccessorRegistrationWarning (Warning ):
159
- """Warning for attribute conflicts in accessor registration."""
159
+ """
160
+ Warning for attribute conflicts in accessor registration.
161
+ """
160
162
161
163
162
164
class AbstractMethodError (NotImplementedError ):
163
- """Raise this error instead of NotImplementedError for abstract methods
165
+ """
166
+ Raise this error instead of NotImplementedError for abstract methods
164
167
while keeping compatibility with Python 2 and Python 3.
165
168
"""
166
169
167
170
def __init__ (self , class_instance , methodtype = "method" ):
168
171
types = {"method" , "classmethod" , "staticmethod" , "property" }
169
172
if methodtype not in types :
170
- msg = f"methodtype must be one of { methodtype } , got { types } instead."
171
- raise ValueError (msg )
173
+ raise ValueError (
174
+ f"methodtype must be one of { methodtype } , got { types } instead."
175
+ )
172
176
self .methodtype = methodtype
173
177
self .class_instance = class_instance
174
178
@@ -177,5 +181,4 @@ def __str__(self) -> str:
177
181
name = self .class_instance .__name__
178
182
else :
179
183
name = type (self .class_instance ).__name__
180
- msg = f"This { self .methodtype } must be defined in the concrete class { name } "
181
- return msg .format (methodtype = self .methodtype , name = name )
184
+ return f"This { self .methodtype } must be defined in the concrete class { name } "
0 commit comments