Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed Jun 5, 2024
1 parent ab76607 commit 9542f6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pyoload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,15 @@ class Check:
"""
checks_list = {}

def __init_subclass__(cls: Any, subclass: Any):
def __init_subclass__(subclass: Any):
"""
register's subclasses as chexks
"""
cls.register(cls.name, cls.__call__)
if hasattr(cls, 'name'):
name = cls.name
else:
name = cls.__name__
cls.register(name, cls())

@classmethod
def register(
Expand Down

0 comments on commit 9542f6e

Please sign in to comment.