diff --git a/stgpytools/types/utils.py b/stgpytools/types/utils.py index a8d6337..da301be 100644 --- a/stgpytools/types/utils.py +++ b/stgpytools/types/utils.py @@ -269,6 +269,10 @@ def __get__( def _wrapper(self: T, *_args: P.args, **kwargs: P.kwargs) -> R: assert this.signature + if not isinstance(self, class_type): # type: ignore + _args = (self, *_args) # type: ignore + self = class_obj # type: ignore + if not hasattr(self, this._kwargs_name): # type: ignore from ..exceptions import CustomRuntimeError @@ -417,7 +421,7 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__dict__: obj = self.__dict__.get(key) - if obj and type(obj) is classproperty: + if obj and isinstance(obj, classproperty): return obj.__set__(self, value) return super(classproperty.metaclass, self).__setattr__(key, value)