[ZCM] [ZC] 1873/ 1 Request "{O,I}X{O,I}BTree dict like behavior"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Aug 22 05:49:08 EDT 2005


Issue #1873 Update (Request) "{O,I}X{O,I}BTree dict like behavior"
 Status Pending, Database/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1873

==============================================================
= Request - Entry #1 by suvit on Aug 22, 2005 5:49 am

>>> import ZODB
>>> from ZODB.PersistentMapping import PersistentMapping
>>> from BTrees.OOBTree import OOBTree

works
>>> d1 = OOBTree()
>>> d1[1] = 1
>>> pm = PersistentMapping({2:2})
>>> d = {1:1}
>>> bt = OOBTree({3:3})
>>> bt.update(d)
>>> pm.update(bt)
>>> dict(bt)
{1: 1, 3: 3}

But not works
>>> OOBTree(pm)
Traceback (most recent call last):
  File "<pyshell#12>", line 1, in ?
    OOBTree(pm)
  File "C:\Python23\Lib\UserDict.py", line 14, in __getitem__
    def __getitem__(self, key): return self.data[key]
KeyError: 0
>>> bt.update(pm)
Traceback (most recent call last):
  File "<pyshell#9>", line 1, in ?
    bt.update(pm)
  File "C:\Python23\Lib\UserDict.py", line 14, in __getitem__
    def __getitem__(self, key): return self.data[key]
KeyError: 0
>>> 

==============================================================



More information about the Zope-Collector-Monitor mailing list