Closed
Description
The visitor.py
file sets the special value REMOVE
to Ellipsis
. However, this causes trouble with type-hinting functions that return REMOVE. Could we create a separate value rather than using Ellipsis
? See the issues linked here, where the consensus is in favor of not using the Ellipsis
constant. Thank you!
Metadata
Metadata
Assignees
Labels
No labels
Activity
Cito commentedon Jun 8, 2020
Maybe we should create an enum
VisitorAction
containing these four special values, and setREMOVE
toVisitorAction.REMOVE
etc. Then adding type hints would be even easier. For backward compatibility, the visitor could still recognize the other special values likeEllipsis
.Would that solve the problem?
LWprogramming commentedon Jun 8, 2020
That would work! Arguably it would work even better because we wouldn't need to update the type-hint every time we have a visitor function return a different special value.
Add enum type for visitor return values (#96)
Cito commentedon Jun 26, 2020
I have implemented this in the master branch now.