Skip to content

Commit

Permalink
Merge pull request #199 from sobolevn/patch-1
Browse files Browse the repository at this point in the history
Fixes `__slots__` definition in `NodeOrLeaf`
  • Loading branch information
davidhalter committed Sep 15, 2021
2 parents ae491cb + c5e8602 commit da3a748
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parso/tree.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit da3a748

Please sign in to comment.