From e0b86d68499887f8207db1bf6de0839df5c58744 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 14 May 2021 14:24:07 -0700 Subject: [PATCH] Remove abc.ABC inheritance to speed up instance checks. --- python/cudf/cudf/core/abc.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/cudf/cudf/core/abc.py b/python/cudf/cudf/core/abc.py index 0439f0d24b8..d3da544f8b5 100644 --- a/python/cudf/cudf/core/abc.py +++ b/python/cudf/cudf/core/abc.py @@ -1,9 +1,7 @@ # Copyright (c) 2020-2021, NVIDIA CORPORATION. """Common abstract base classes for cudf.""" -import abc import sys -from abc import abstractmethod import rmm @@ -18,7 +16,7 @@ import pickle # type: ignore -class Serializable(abc.ABC): +class Serializable: """A serializable object composed of device memory buffers. This base class defines a standard serialization protocol for objects @@ -32,7 +30,6 @@ class Serializable(abc.ABC): latter converts back from that representation into an equivalent object. """ - @abstractmethod def serialize(self): """Generate an equivalent serializable representation of an object. @@ -53,10 +50,11 @@ def serialize(self): :meta private: """ - pass + raise NotImplementedError( + "Subclasses of Serializable must implement serialize" + ) @classmethod - @abstractmethod def deserialize(cls, header, frames): """Generate an object from a serialized representation. @@ -80,7 +78,9 @@ class can be constructed from a serialized representation generalized :meta private: """ - pass + raise NotImplementedError( + "Subclasses of Serializable must implement deserialize" + ) def device_serialize(self): """Serialize data and metadata associated with device memory.