(*args)
| 746 | |
| 747 | # @lru_cache - TODO enable caching - ATM dict being non hashable is causing issues with LRU cache |
| 748 | def get_node_visitors(*args) -> Dict[str, NodeVisitor]: |
| 749 | node_visitors = {} |
| 750 | """ |
| 751 | Create a new class instance at runtime, and put them in a dict |
| 752 | """ |
| 753 | for target, visitor in _node_visitor_dict.items(): |
| 754 | assert callable( |
| 755 | visitor |
| 756 | ), f"Expecting a callable class, but got {visitor} of type {type(visitor)}" |
| 757 | node_visitors[target] = visitor(*args) |
| 758 | return node_visitors |