diff --git a/parso/python/tree.py b/parso/python/tree.py index e2bf010..f6b4dd3 100644 --- a/parso/python/tree.py +++ b/parso/python/tree.py @@ -60,7 +60,6 @@ _GET_DEFINITION_TYPES = set([ _IMPORTS = set(['import_name', 'import_from']) - class DocstringMixin(object): __slots__ = () @@ -133,7 +132,6 @@ class PythonLeaf(PythonMixin, Leaf): return previous_leaf.end_pos - class _LeafWithoutNewlines(PythonLeaf): """ Simply here to optimize performance. @@ -166,6 +164,10 @@ class EndMarker(_LeafWithoutNewlines): __slots__ = () type = 'endmarker' + @utf8_repr + def __repr__(self): + return "<%s: prefix=%s>" % (type(self).__name__, repr(self.prefix)) + class Newline(PythonLeaf): """Contains NEWLINE and ENDMARKER tokens.""" @@ -235,7 +237,6 @@ class Name(_LeafWithoutNewlines): return None - class Literal(PythonLeaf): __slots__ = () @@ -653,6 +654,7 @@ class Function(ClassOrFunc): except IndexError: return None + class Lambda(Function): """ Lambdas are basically trimmed functions, so give it the same interface.