Skip to content

Commit d587e33

Browse files
committed
mark DepthFirstVisitor as final and add slots
1 parent b69e1ff commit d587e33

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lambda_calculus/visitors/walking.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from __future__ import annotations
66
from collections.abc import Iterator
7-
from typing import TypeVar
7+
from typing import TypeVar, final
88
from .. import terms
99
from . import BottomUpVisitor
1010

@@ -15,6 +15,7 @@
1515
V = TypeVar("V")
1616

1717

18+
@final
1819
class DepthFirstVisitor(BottomUpVisitor[Iterator["terms.Term[V]"], V]):
1920
"""
2021
Visitor yielding subterms depth first
@@ -24,6 +25,8 @@ class DepthFirstVisitor(BottomUpVisitor[Iterator["terms.Term[V]"], V]):
2425
V: represents the type of variables used in terms
2526
"""
2627

28+
__slots__ = ()
29+
2730
def visit_variable(self, variable: terms.Variable[V]) -> Iterator[terms.Term[V]]:
2831
"""
2932
Visit a Variable term.

0 commit comments

Comments
 (0)