Bug with super() and reload()?

Jp Calderone exarkun at intarweb.us
Thu Jan 16 15:12:22 EST 2003


On Thu, Jan 16, 2003 at 06:25:48PM +0000, Michael Hudson wrote:
> Jp Calderone <exarkun at intarweb.us> writes:
> 
> >   One could look at it as a wart, though I personally wouldn't.  Regardless,
> > it can be worked around.
> > 
> > See twisted.python.rebuild (http://www.twistedmatrix.com) for an example of
> > how ;)
> 
> That might have difficulties with a list of instances, no?
> 

  Nope.  The most common usage (for me, anyway) is to pick a particular
module and target it, rather than updating instances individually. 
Everything is taken care of automatically in this case, either with the gc
module or with a magical __getattr__ if gc is not available.

> Also these lines:
> 
>         if not hasattr(mod, '__dict__'):
>             # It's a builtin module; nothing to replace here.
>             continue
> 
> baffle me.  How did you manage that?
> 
> >>> len(sys.__dict__)
> 44
> >>> len(termios.__dict__) 
> 231


  Ahh, I wrote up a nice description of why this is the way it is, but then
I investigated a little and now I think it's just a weird workaround for a
bug in the cReactor module (a C implementation of part of the core).  Now
that I realize this the above check will probably go away and cReactor will
be fixed.  ;)  Thanks

  Jp

-- 
There are 10 kinds of people: those who understand binary and those who do
not.
--
 12:00am up 31 days, 9:48, 2 users, load average: 0.07, 0.09, 0.04
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030116/5a85f21a/attachment.sig>


More information about the Python-list mailing list