Reputation: 1108
I have a string with python code inside, for example:
df.head()
and
df.dropna(inplace=True)
Is it possible, using ast to know whether the execution will change initial variable(second case) or not(first case)
Upvotes: 1
Views: 32
Reputation: 13085
No, this is not possible in the general case as outlined in the Halting Problem. This goes for all languages, not just python.
Upvotes: 4