Skip to content

Commit

Permalink
feat(rules): add decorator: aliases for class attribute property
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Jun 27, 2024
1 parent a0ebfdc commit e8fc106
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hrc/rules/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import functools
from typing import Generic, Any, Type

from abc import ABC
Expand All @@ -8,5 +9,11 @@

class Rules(ABC, Generic[RulesT]):
...




def aliases(names, ignore_case=False):
def decorator(func):
func._aliases = names
func._ignore_case = ignore_case
return func
return decorator

0 comments on commit e8fc106

Please sign in to comment.