fix: removes inheritance warning for functions

This commit is contained in:
Mose Müller 2023-12-11 12:05:27 +01:00
parent c15ad54e2d
commit 0694a3d1ee
2 changed files with 4 additions and 1 deletions

View File

@ -70,7 +70,7 @@ class DataService(rpyc.Service, AbstractDataService):
# every class defined by the user should inherit from DataService if it is
# assigned to a public attribute
if not __name.startswith("_"):
if not __name.startswith("_") and not inspect.isfunction(__value):
self.__warn_if_not_observable(__value)
# Set the attribute

View File

@ -56,6 +56,9 @@ def test_basic_inheritance_warning(caplog: LogCaptureFixture) -> None:
def some_method(self) -> None:
...
async def some_task(self) -> None:
...
ServiceClass()
# neither of the attributes, methods or properties cause a warning log