Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type hints for SafeEval.nodes, opmaps #2

Open
pandaxtc opened this issue Sep 27, 2023 · 0 comments
Open

Incorrect type hints for SafeEval.nodes, opmaps #2

pandaxtc opened this issue Sep 27, 2023 · 0 comments

Comments

@pandaxtc
Copy link

Hello! I believe that the dicts nodes, unaryOpMap, and dualOpMap initialized in SafeEval's constructor have the wrong type hints. For example,

self.nodes: Dict[ast.AST, Callable[[ast.AST, Dict[str, Any]], Any]] = {

The type hint Dict[ast.AST, ...] should instead be Dict[type[ast.AST], ...]. The current hint indicates a dict with keys that are instances of AST, and not the classes themselves.

Thank you for the package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant