Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
Is someone out there familiar with IronPython internals, specifically with PythonAst and LanguageContext classes ?

My application does compile a Python script source and then look into PythonAst to find variables. While I can successfully find global variables, I am unable to get functions' local variables. Is it possible somehow ?

Another question would be to also find the current type of a variable as it can be inferred from the compiled code as well as its current value ?

After a script was executed I can use the ScriptScope structure, or at debug time I can parse a debug frame for variables and theirs value, but I would like to do it at compile time also, as the user constructs the code. Is this possible at all ?

Thanks.

What I have tried:

Tried enumerating Variables dictionary in PythonAst class, but it only contains globals.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900