From 8244725a22a999809dac679f6f720a45715b4f9a Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Wed, 4 Dec 2019 23:17:01 +0200 Subject: [PATCH] STY: Style fix --- pandas/errors/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pandas/errors/__init__.py b/pandas/errors/__init__.py index 43ce8ad4abb45..ebe9a3d5bf472 100644 --- a/pandas/errors/__init__.py +++ b/pandas/errors/__init__.py @@ -156,19 +156,23 @@ class MergeError(ValueError): class AccessorRegistrationWarning(Warning): - """Warning for attribute conflicts in accessor registration.""" + """ + Warning for attribute conflicts in accessor registration. + """ class AbstractMethodError(NotImplementedError): - """Raise this error instead of NotImplementedError for abstract methods + """ + Raise this error instead of NotImplementedError for abstract methods while keeping compatibility with Python 2 and Python 3. """ def __init__(self, class_instance, methodtype="method"): types = {"method", "classmethod", "staticmethod", "property"} if methodtype not in types: - msg = f"methodtype must be one of {methodtype}, got {types} instead." - raise ValueError(msg) + raise ValueError( + f"methodtype must be one of {methodtype}, got {types} instead." + ) self.methodtype = methodtype self.class_instance = class_instance @@ -177,5 +181,4 @@ def __str__(self) -> str: name = self.class_instance.__name__ else: name = type(self.class_instance).__name__ - msg = f"This {self.methodtype} must be defined in the concrete class {name}" - return msg.format(methodtype=self.methodtype, name=name) + return f"This {self.methodtype} must be defined in the concrete class {name}"