[Pyrex] Re: Globals and wrapping Eiffel
Godefroid Chapelle
gotcha at bubblenet.be
Wed Nov 19 21:09:09 CET 2003
Andreas Kostyrka wrote:
> On Wed, Nov 19, 2003 at 03:31:18PM +0100, Godefroid Chapelle wrote:
>
>>This was the question I wanted to ask : is there a way in Pyrex to
>>declare some code that must run once when the extension module is imported ?
>
> Does this answer your question:
Yes, thanks
> Python 2.3 (#2, Sep 8 2003, 13:25:25)
> [GCC 2.95.3 20010315 (SuSE)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
>>>>import t
>
> hello
>
>>>>import t
>>>>import t
>>>>import t
>>>>del t
>>>>import t
>>>>print open("t.pyx").read()
>
> print "hello"
>
The only thing I am not sure about is this one :
I suppose that the del statement just erases the 't' name from the
namespace while keeping the module loaded
> Andreas
--
Godefroid Chapelle (aka __gotcha) http://bubblenet.be
More information about the Pyrex
mailing list