From 1139e53429e46fc35eadd3d70f6096aa3077047c Mon Sep 17 00:00:00 2001 From: Peter Law Date: Sun, 3 Jan 2021 17:55:16 +0000 Subject: [PATCH] Inline these type annotations No need for comments for these since Python 3.5 isn't supported. --- parso/python/prefix.py | 2 +- parso/tree.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parso/python/prefix.py b/parso/python/prefix.py index 75390ae..38b750c 100644 --- a/parso/python/prefix.py +++ b/parso/python/prefix.py @@ -14,7 +14,7 @@ class PrefixPart: self.type = typ self.value = value self.spacing = spacing - self.start_pos = start_pos # type: Tuple[int, int] + self.start_pos: Tuple[int, int] = start_pos @property def end_pos(self) -> Tuple[int, int]: diff --git a/parso/tree.py b/parso/tree.py index a54d875..312c80b 100644 --- a/parso/tree.py +++ b/parso/tree.py @@ -192,7 +192,7 @@ class Leaf(NodeOrLeaf): :py:func:`str` Typically a mixture of whitespace and comments. Stuff that is syntactically irrelevant for the syntax tree. ''' - self.parent = None # type: Optional[BaseNode] + self.parent: Optional[BaseNode] = None ''' The parent :class:`BaseNode` of this leaf. ''' @@ -264,7 +264,7 @@ class BaseNode(NodeOrLeaf): """ A list of :class:`NodeOrLeaf` child nodes. """ - self.parent = None # type: Optional[BaseNode] + self.parent: Optional[BaseNode] = None ''' The parent :class:`BaseNode` of this leaf. None if this is the root node.