[Zope-Coders] inheritedAttributes py2.1.3 vs py2.2.3

alan runyan runyaga@runyaga.com
Tue, 01 Jul 2003 02:07:17 -0500


Hi.

I was trying to get Acquisition to play nice with threading (the
production/development boxes are running python2.1.3).  I am
seeing some unexpected behavior and was just wondering if anyone
could point me to a mailing list entry that would clarify things.

code in question:

class Worker(Acquisition.Implicit, threading.Thread):
    def __init__(self):
        Worker.inheritedAttribute('__init__')(self)
    def run(self):
        print 'whew!'

under python2.2.3 using Zope2.6.2b3 this code works fine.
>>> t1=Worker()
>>> t1
<Worker(Thread-1, initial)>

now under python2.1.3 using Zope2.6.1 (I would expect things to work the 
same)
>>> t1=Worker()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<stdin>", line 3, in __init__
  File "/usr/local/lib/python2.1/threading.py", line 326, in __init__
    _Verbose.__init__(self, verbose)
TypeError: unbound method __init__() must be called with instance as first 
argument

version:
'2.1.3 (#1, Oct 24 2002, 01:35:39) \n[GCC 2.96 20000731 (Mandrake Linux 8.2 
2.96-0.76mdk)]'

is there anything I can do to get this to work on Python2.1.3?  I sort of 
have a production
system running 2.1.3 (Zope2.6.1).  If I migrate to 2.2.3 and Zope2.6.2b3 - 
are there any
outstanding gotchas?

this seems pretty fundamental - am I wrong in assuming that this should 
have worked like
the ExtensionClass.html docs in Components/ExtensionClass advetises the use 
of inheritedAttribute?

cheers,
-- 
alan runyan

~runyaga@
Clearnoodle Studio
http://www.clearnoodle.com/