Re: [ZODB-Dev] "Advanced ZODB for Python Programmers" article: volatile example

2010-05-24 Thread Vincent Pelletier
Le lundi 24 mai 2010 12:02:40, Wichert Akkerman a écrit : > which prevents the exception overhead. Right, thought this is a tradeoff question: writing as exception handling is faster for "volatile is present" case, but slower for "volatile is missing" case. -- Vincent Pelletier ___

Re: [ZODB-Dev] "Advanced ZODB for Python Programmers" article: volatile example

2010-05-24 Thread Wichert Akkerman
On 5/24/10 13:59 , Vincent Pelletier wrote: > Hi. > > I think the example on volatile attributes given in "Advanced ZODB for Python > Programmers" article[1] shows a bad practice. > >> From the article: > if hasattr(self, '_v_image'): > return self._v_image > > This should be rewritte

[ZODB-Dev] "Advanced ZODB for Python Programmers" article: volatile example

2010-05-24 Thread Vincent Pelletier
Hi. I think the example on volatile attributes given in "Advanced ZODB for Python Programmers" article[1] shows a bad practice. >From the article: if hasattr(self, '_v_image'): return self._v_image This should be rewritten as: try: return self._v_image except Attribu