Skip to content

Commit b7f0d36

Browse files
committed
refact: rename decorator to be more PEP8
1 parent 298c591 commit b7f0d36

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/api/decorator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections.abc import Callable
22

33

4-
class classproperty:
4+
class ClassProperty:
55
"""Decorator for class properties.
66
Use @classproperty instead of @property to add properties
77
to the class object.
@@ -12,3 +12,8 @@ def __init__(self, fget: Callable[[type], Callable]) -> None:
1212

1313
def __get__(self, owner_self, owner_cls: type):
1414
return self.fget(owner_cls)
15+
16+
17+
def classproperty(fget: Callable[[type], Callable]) -> ClassProperty:
18+
"""Use this function as the decorator in lowercase to follow Python conventions."""
19+
return ClassProperty(fget)

0 commit comments

Comments
 (0)