Ed Leafe wrote:
> On Jun 20, 2007, at 2:26 PM, <[EMAIL PROTECTED]>  
> <[EMAIL PROTECTED]> wrote:
> 
>> Ah...I see.  VFP thinking going on here.  I thought that
>> ret = self._saveNewUnchanged = False
>> Was in effect  ret = (self._saveNewUnchanged = False) ...a logical
>> evaluation that was getting passed to ret.
>>
>> In the words of the late, great Rosanne Rossanadanna..."Never mind..."
> 
>       OK, I see what you were thinking. Yeah, this is a cool Python idiom  
> that we use a lot, especially in properties to handle default values.

And, unlike VFP, you can't evaluate with "=", you must use "==". So, 
your line would have been:

ret = self._saveNewUnchanged == False

...which would have raised an AttributeError if self._saveNewUnchanged 
had never been assigned yet, or would have contained the result of the 
evaluation if it had.

But in Python, we'd never say 'if someBool == False', we'd say 'if not 
someBool'.


-- 
pkm ~ http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to