def __init__(self, callable): self._callable = _get_callable(callable) self._cls = False if callable is not self._callable: is_cls = not inspect.isfunction(self._callable) is_cls = is_cls and ( not inspect.isbuiltin(self._callable) ) is_cls = is_cls and (not inspect.isclass(self._callable)) if is_cls: if ec._is_supported(): self._callable._streamsx_ec_op = ec._get_opc(self._callable) self._cls = True ec._callable_enter(self._callable) ec._clear_opc()
def __init__(self, callable_, attributes=None): self._callable = _get_callable(callable_) self._cls = False self._attributes = attributes if callable_ is not self._callable: is_cls = not inspect.isfunction(self._callable) is_cls = is_cls and ( not inspect.isbuiltin(self._callable) ) is_cls = is_cls and (not inspect.isclass(self._callable)) if is_cls: if ec._is_supported(): self._callable._streamsx_ec_op = ec._get_opc(self._callable) self._cls = True ec._callable_enter(self._callable) if hasattr(self._callable, '_splpy_entered'): self._splpy_entered = self._callable._splpy_entered ec._clear_opc()