mirror of
https://github.com/davidhalter/parso.git
synced 2026-08-13 19:41:03 +08:00
Inline these type annotations
No need for comments for these since Python 3.5 isn't supported.
This commit is contained in:
@@ -14,7 +14,7 @@ class PrefixPart:
|
|||||||
self.type = typ
|
self.type = typ
|
||||||
self.value = value
|
self.value = value
|
||||||
self.spacing = spacing
|
self.spacing = spacing
|
||||||
self.start_pos = start_pos # type: Tuple[int, int]
|
self.start_pos: Tuple[int, int] = start_pos
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def end_pos(self) -> Tuple[int, int]:
|
def end_pos(self) -> Tuple[int, int]:
|
||||||
|
|||||||
+2
-2
@@ -192,7 +192,7 @@ class Leaf(NodeOrLeaf):
|
|||||||
:py:func:`str` Typically a mixture of whitespace and comments. Stuff
|
:py:func:`str` Typically a mixture of whitespace and comments. Stuff
|
||||||
that is syntactically irrelevant for the syntax tree.
|
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.
|
The parent :class:`BaseNode` of this leaf.
|
||||||
'''
|
'''
|
||||||
@@ -264,7 +264,7 @@ class BaseNode(NodeOrLeaf):
|
|||||||
"""
|
"""
|
||||||
A list of :class:`NodeOrLeaf` child nodes.
|
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.
|
The parent :class:`BaseNode` of this leaf.
|
||||||
None if this is the root node.
|
None if this is the root node.
|
||||||
|
|||||||
Reference in New Issue
Block a user