20 lines
383 B
Python
20 lines
383 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
|
||
|
####################
|
||
|
# Static functions #
|
||
|
####################
|
||
|
|
||
|
# Imports
|
||
|
from tubot.static.abc import IValidatable
|
||
|
|
||
|
|
||
|
async def validate(obj: IValidatable) -> bool:
|
||
|
"""
|
||
|
Checks the validity of the object
|
||
|
|
||
|
:return: Object validity boolean
|
||
|
"""
|
||
|
if await obj.__validate__():
|
||
|
return True
|
||
|
raise TypeError("Object validation failed")
|