[Pyrex] defining extern variables in pyrex

Michael JasonSmith mpj17 at student.canterbury.ac.nz
Wed Apr 13 01:57:32 CEST 2005


On Tue, 2005-04-12 at 18:58 -0400, David M. Cooke wrote:
> 2) (Better, more intrusive) Modify the library. Remove the global
>    variables, and pass the state variables to each library routine.
>    This becomes easy if you make a struct whose members are the old
>    global variables, and pass that struct to each routine (instead of
>    passing each variable individually). Again, keep that state in your
>    wrapped class.
This is indeed a nice solution. I really should add a page to my Pyrex
Guide on global variables. However, I am afraid that I would end up
advocating violence against all those that write modules that use them!

-- 
Michael JasonSmith                  http://www.ldots.org/





More information about the Pyrex mailing list