Re: [Pyparsing] Question/help with pyparsing
Brought to you by:
ptmcg
From: Ralph C. <ra...@in...> - 2007-11-10 10:58:01
|
Hi Vineet, > I allow the users of my application to write small rules as python > code. I use pylint to find errors in code they enter. As part of the > user code they are required to enter a list (lista) and a couple of > dicts (dict1, dict2) at the module level. I guess dict1's values can also be dicts, lists, etc. > I use lista, dict1, dict2 to add variables to the module dynamically > at run time. The problem I'm having is that pylint complains of the > dynamic variables that are set in lista and dict1 and dict2. So I was > thinking of having a multiple stage effort to find syntax errors with > the user python code. Have you considered using codeop.py to attempt to compile their Python list and dict code? If you're wary of them doing unwanted stuff in the code they provide then maybe opcode.py can then be used to scan through the compiled bytecode to check they're just doing simple dict and list construction? Cheers, Ralph. |