Go Back   Velocity Reviews > Newsgroups > Python
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Python - Re: variables bound in moudules are None when module is notcompletely imported

 
Thread Tools Search this Thread
Old 02-25-2009, 11:24 PM   #1
Default Re: variables bound in moudules are None when module is notcompletely imported


On Wed, Feb 25, 2009 at 05:05:28PM -0200, Gabriel Genellina wrote:
> I'd try to move all the global stuff in that module into a function,
> "init". Importing the module will always succeed - you have to manually
> call init() after importing it.


i normally do that anyway and would also have done so here (afaik, it's
best practice anyway), but this is in this case not possible as the
modules in question are not under my control at all. as pep 299 has been
turned down, this can't really be considered a bug of those files.

anyway, it would just be another workaround around the globals
disappearing.

> That makes a strange situation where the module doesn't exist in
> sys.modules but its globals are still alive...


is this a known bug? i mean from a garbage collection / refcount point
of view, at least everything that is still referenced somewhere should
be preserved.

thanks
chrysn

--
To use raw power is to make yourself infinitely vulnerable to greater powers.
-- Bene Gesserit axiom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkml0y0ACgkQX+8/P49kuRjP+wCfQy3bWzBC4E6bDdzxPpHs/g7w
h6gAnj7oesGiaBt+0yCsehQuIl9VZBhs
=zso+
-----END PGP SIGNATURE-----



chrysn@fsfe.org
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46