[ZODB-Dev] Article on ZODB Programming

Greg Ward gward@mems-exchange.org
Thu, 21 Jun 2001 09:41:35 -0400


On 19 June 2001, Andrew Kuchling said:
> This seems reasonable to me.  I think of the ZODB providing a
> programming language slightly different from Python, one that has
> transactional semantics on object modification.  In this view, it's
> perfectly reasonable to add a new built-in function for getting the
> current transaction.  

Interesting -- I completely disagree.  ZODB doesn't *implicitly* change
class semantics; you must explicitly inherit from Persistent to change
the semantics of a particular class.  Like any sane extension, it
doesn't change Python, it just adds to it (albeit in a much deeper way
than usual).  I don't see why get_transaction() should be implicitly
added as a builtin -- I would much rather have the tiny inconvenience of
typing

  from ZODB import get_transaction

than the sly implicitness of somebody fiddling __builtins__ behind my
back.  Explicit is better than implicit!

        Greg
-- 
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org