Skip to content
This repository was archived by the owner on Jun 6, 2025. It is now read-only.
This repository was archived by the owner on Jun 6, 2025. It is now read-only.

Incorrect type hints for SafeEval.nodes, opmaps #2

Description

@pandaxtc

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions