From c5e8602cae6c24be66c725fba270adb30c300955 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 15 Sep 2021 02:33:53 +0300 Subject: [PATCH] Fixes `__slots__` definition in `NodeOrLeaf` --- parso/tree.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parso/tree.py b/parso/tree.py index a379a15..e529871 100644 --- a/parso/tree.py +++ b/parso/tree.py @@ -26,7 +26,7 @@ class NodeOrLeaf: """ The base class for nodes and leaves. """ - __slots__ = () + __slots__ = ('parent',) type: str ''' The type is a string that typically matches the types of the grammar file. @@ -290,7 +290,7 @@ class Leaf(NodeOrLeaf): Leafs are basically tokens with a better API. Leafs exactly know where they were defined and what text preceeds them. ''' - __slots__ = ('value', 'parent', 'line', 'column', 'prefix') + __slots__ = ('value', 'line', 'column', 'prefix') prefix: str def __init__(self, value: str, start_pos: Tuple[int, int], prefix: str = '') -> None: @@ -369,7 +369,7 @@ class BaseNode(NodeOrLeaf): The super class for all nodes. A node has children, a type and possibly a parent node. """ - __slots__ = ('children', 'parent') + __slots__ = ('children',) def __init__(self, children: List[NodeOrLeaf]) -> None: self.children = children