You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Likely this code - where the isinstance for a type is called:
class_rewrite_captured_vars(ast.NodeTransformer):
def__init__(self, cv: inspect.ClosureVars):
self._lookup_dict: Dict[str, Any] =dict(cv.nonlocals)
self._lookup_dict.update(cv.globals)
self._ignore_stack= []
defvisit_Name(self, node: ast.Name) ->Any:
ifself.is_arg(node.id):
returnnodeifnode.idinself._lookup_dict:
v=self._lookup_dict[node.id]
ifnotcallable(v):
# Modules should be sent on down to be dealt with by the# backend.ifnotisinstance(v, ModuleType):
legal_capture_types= [str, int, float, bool, complex, str, bytes]
iftype(v) notinlegal_capture_types:
raiseValueError(
f"Do not know how to capture data type '{type(v).__name__}' for "f"variable '{node.id}' - only "f"{', '.join([c.__name__forcinlegal_capture_types])} are ""supported."
)
returnas_literal(v)
elifisinstance(v, type):
assertFalsereturnnode
And then in a
lambda
expression we should allow forfork.it
.This will also change how enums are done, so this will have far reaching (probably) implications.
The text was updated successfully, but these errors were encountered: