[Zodb-checkins] CVS: ZODB3 - NEWS.txt:1.42

Jeremy Hylton jeremy at zope.com
Mon Jan 5 16:03:17 EST 2004


Update of /cvs-repository/ZODB3
In directory cvs.zope.org:/tmp/cvs-serv9104

Modified Files:
	NEWS.txt 
Log Message:
Add the news from the 3.3a1 release.


=== ZODB3/NEWS.txt 1.41 => 1.42 ===
--- ZODB3/NEWS.txt:1.41	Mon Jan  5 16:00:18 2004
+++ ZODB3/NEWS.txt	Mon Jan  5 16:03:16 2004
@@ -24,6 +24,9 @@
 - persistent.mapping.PersistentMapping
 - persistent.TimeStamp
 
+Multi-version concurrency control
+---------------------------------
+
 ZODB now supports multi-version concurrency control (MVCC) for
 storages that support multiple revisions.  FileStorage and
 BDBFullStorage both support MVCC.  In short, MVCC means that read
@@ -37,6 +40,9 @@
 conflicts.  It is possibe to disable the MVCC feature using the mvcc
 keyword argument to the DB open() method, ex.: db.open(mvcc=False).
 
+Miscellaneous
+-------------
+
 Changed the ZEO server and control process to work with a single
 configuration file; this is now the default way to configure these
 processes.  (It's still possible to use separate configuration files.)
@@ -63,6 +69,101 @@
 
 The prefix used for log messages from runzeo.py was changed from
 RUNSVR to RUNZEO.
+
+What's new in ZODB3 3.3 alpha 1
+===============================
+Release date: 17-Jul-2003
+
+New features of Persistence
+---------------------------
+
+The Persistent base class is a regular Python type implemented in C.
+It should be possible to create new-style classes that inherit from
+Persistent, and, thus, use all the new Python features introduced in
+Python 2.2 and 2.3.
+
+The __changed__() method on Persistent objects is no longer supported.
+
+New features in BTrees
+----------------------
+
+BTree, Bucket, TreeSet and Set objects are now iterable objects, playing
+nicely with the iteration protocol introduced in Python 2.2, and can
+be used in any context that accepts an iterable object.  As for Python
+dicts, the iterator constructed for BTrees and Buckets iterates
+over the keys.
+
+>>> from BTrees.OOBTree import OOBTree
+>>> b = OOBTree({"one": 1, "two": 2, "three": 3, "four": 4})
+>>> for key in b: # iterates over the keys
+...    print key
+four
+one
+three
+two
+>>> list(enumerate(b))
+[(0, 'four'), (1, 'one'), (2, 'three'), (3, 'two')]
+>>> i = iter(b)
+>>> i.next()
+'four'
+>>> i.next()
+'one'
+>>> i.next()
+'three'
+>>> i.next()
+'two'
+>>>
+
+As for Python dicts in 2.2, BTree and Bucket objects have new
+.iterkeys(), .iteritems(), and .itervalues() methods.  TreeSet and Set
+objects have a new .iterkeys() method.  Unlike as for Python dicts,
+these new methods accept optional min and max arguments to effect
+range searches.  While Bucket.keys() produces a list, Bucket.iterkeys()
+produces an iterator, and similarly for Bucket values() versus
+itervalues(), Bucket items() versus iteritems(), and Set keys() versus
+iterkeys().  The iter{keys,values,items} methods of BTrees and the
+iterkeys() method of Treesets also produce iterators, while their
+keys() (etc) methods continue to produce BTreeItems objects (a form of
+"lazy" iterator that predates Python 2.2's iteration protocol).
+
+>>> sum(b.itervalues())
+10
+>>> zip(b.itervalues(), b.iterkeys())
+[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]
+>>>
+
+BTree, Bucket, TreeSet and Set objects also implement the __contains__
+method new in Python 2.2, which means that testing for key membership
+can be done directly now via the "in" and "not in" operators:
+
+>>> "won" in b
+False
+>>> "won" not in b
+True
+>>> "one" in b
+True
+>>>
+
+All old and new range-search methods now accept keyword arguments,
+and new optional excludemin and excludemax keyword arguments.  The
+new keyword arguments allow doing a range search that's exclusive
+at one or both ends (doesn't include min, and/or doesn't include
+max).
+
+>>> list(b.keys())
+['four', 'one', 'three', 'two']
+>>> list(b.keys(max='three'))
+['four', 'one', 'three']
+>>> list(b.keys(max='three', excludemax=True))
+['four', 'one']
+>>>
+
+Other improvements
+------------------
+
+The exceptions generated by write conflicts now contain the name of
+the conflicted object's class.  This feature requires support for the
+storage.  All the standard storages support it.
 
 What's new in ZODB3 3.2
 ========================




More information about the Zodb-checkins mailing list