[Zope-dev] PersitentList seems broken

Andrew Wilcox circle@gwi.net
Mon, 27 Mar 2000 10:01:35 -0500


At 09:26 PM 3/26/00 -0500, you wrote:
>I havent been able to track down whats causing this error, but
>PersistentList seems to be broken.

>>>> import Persistence
>>>> from Persistence import PersistentMapping
>>>> from Zodb import PersistentList
>>>> a = PersistentList()
>Traceback (innermost last):
>  File "C:\Zope\WebSite\ZServer\medusa\monitor.py", line 119, in
>found_terminator
>    exec co in self.local_env
>  File "<secure_monitor_channel connected 127.0.0.1:2312 at e53bf0>", line
>1, in ?
>TypeError: call of non-function (type module)
>>>> b = PersistentMapping()


Yes, this is confusing.  PersistentList is the name of the module, and also
the name of the class within the module.  What you're getting is the
module, which is why it can't be called.  To get to the class, you can
either specify it explicitly:

   import ZODB
   import PersistentList

   mylist = PersistentList.PersistentList()

Or, you can pull the class into your namespace:

   import ZODB
   from PersistentList import PersistentList

   mylist = PersistentList()


Hope this helps,

Andrew