summaryrefslogtreecommitdiff
path: root/grc/core/Element.pyi
diff options
context:
space:
mode:
Diffstat (limited to 'grc/core/Element.pyi')
-rw-r--r--grc/core/Element.pyi25
1 files changed, 10 insertions, 15 deletions
diff --git a/grc/core/Element.pyi b/grc/core/Element.pyi
index 46c6d3480d..2a2aed401c 100644
--- a/grc/core/Element.pyi
+++ b/grc/core/Element.pyi
@@ -15,32 +15,27 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+from typing import Union
+
from . import Platform, FlowGraph, Block
-def lazy_property(func):
- return func
+lazy_property = property # fixme: descriptors don't seems to be supported
class Element(object):
- def __init__(self, parent=None):
- ...
+ def __init__(self, parent: Union[None, 'Element'] = None): ...
- @property
- def parent(self): -> 'Element'
- ...
+ @lazy_property
+ def parent(self) -> 'Element': ...
- def get_parent_by_type(self, cls): -> 'Element'
- ...
+ def get_parent_by_type(self, cls) -> Union[None, 'Element']: ...
@lazy_property
- def parent_platform(self): -> Platform.Platform
- ...
+ def parent_platform(self) -> Platform.Platform: ...
@lazy_property
- def parent_flowgraph(self): -> FlowGraph.FlowGraph
- ...
+ def parent_flowgraph(self) -> FlowGraph.FlowGraph: ...
@lazy_property
- def parent_block(self): -> Block.Block
- ...
+ def parent_block(self) -> Block.Block: ...