[C++-sig] PyEval_EvalCode

Alan Baljeu alanbaljeu at yahoo.com
Tue Nov 11 17:37:19 CET 2008


I was reading some legacy code we have here, and discovered an unexpected idiom.  Starting from C++, we create a dictionary, store a few named constants in there, and then call PyEval_EvalCode passing in the dictionary.  The code it calls is a bunch of python files generated from a CAD model, with no function definitions.  It works of course.  Question is, what do you think of this approach?  What is a more typical idiom?

 Alan Baljeu


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at
http://ca.toolbar.yahoo.com.


More information about the Cplusplus-sig mailing list