If I have:
def my_func(x: str) -> void:
//
def my_caller_func()-> void
local_var = "xyz"
local_var_2 = "zzz"
my_func(x=local_var)
I am trying to write a libcst visitor that will detect that the input value passed into my_func's x input is "xyz"
Is that possible?
I think you might find a decorator could do something like what you are looking to do (not knowing anything about
libcst
). You seem to want to be able to do "something" if the value passed tomy_func()
is"xyz"
potentially without modification tomy_funct()
.A decorator seems to fit the bill...
That should give you:
If that would help.