Skip to content

Commit

Permalink
deprecate init() due to inheritence issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiyuanChen committed Nov 7, 2022
1 parent 3dc1892 commit cfbf89f
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions chanfig/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ def __init__(self, *args, default_factory: Optional[Callable] = None, **kwargs):
)
self.setattr("indent", 2)
self._init(*args, **kwargs)
self.init()

def _init(self, *args, **kwargs) -> None:
r"""
Expand All @@ -431,18 +430,6 @@ def _init(self, *args, **kwargs) -> None:
for key, value in kwargs.items():
self.set(key, value)

def init(self) -> None:
r"""
Setting values for OrderedDict.
This method is called in `__init__`.
You can overwrite this method instead of `__init__` as constructor to avoid call of `super().__init__()`
Args:
*args: [(key1, value1), (key2, value2)].
**kwargs: {key1: value1, key2: value2}.
"""

def get(self, name: str, default: Optional[Any] = None) -> Any:
r"""
Get value from OrderedDict.
Expand Down

0 comments on commit cfbf89f

Please sign in to comment.