[Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/branches/tlotze/src/zope/interface/interface.py Simplifying some idioms, coding style.

Thomas Lotze tl at gocept.com
Tue Aug 23 05:24:09 EDT 2005


On Mon, 22 Aug 2005 11:18:44 -0400, Benji York wrote:

> I didn't review your entire check in (and I realize that this is on a 
> branch), but the non-use of setdefault there was probably intentional to 
> keep from constructing empty dicts and lists when they may not be used.

A simple timing test suggests that using setdefault is actually faster,
the construction of empty dicts and objects notwithstanding.

> If you're looking for a simplification here, I'd use "+" rather than "%" 
> above, for example:
> 
>      sig.append("*" + self.varargs)

ACK

-- 
Thomas Lotze



More information about the Zope3-dev mailing list