25 lines
558 B
Python
25 lines
558 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
##########################################
|
|
# Shared Abstract classes and interfaces #
|
|
##########################################
|
|
|
|
# Imports
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class IValidatable(ABC):
|
|
"""
|
|
Interface initializing a class with a magic method for
|
|
checking the validity of its objects
|
|
"""
|
|
|
|
@abstractmethod
|
|
async def __validate__(self) -> bool:
|
|
"""
|
|
Checks if the object of the class is valid
|
|
|
|
:return: Object validity boolean
|
|
"""
|
|
raise NotImplementedError
|