On Aug 23, 2013, at 6:34 PM, jason kirtland <j...@discorporate.us> wrote:

> 
> The patch seems like surprising Python behavior to me. Traversing across a 
> None is almost certainly a bug in regular code, and quashing that error by 
> default feels dangerous. I would want this to raise by default (and I have 
> found bugs because it did.)  I think you could opt into this behavior by 
> supplying an alternate, custom getter function that quashed None when 
> creating the proxy.

Looking at the tests in this area, I can see that they expect an error to be 
raised on scalar access of a None; though the tests in this area have 
apparently been long broken since we moved to nosetests, where we've lost 
access to the "fail()" method.

I find it surprising that we would want to raise on a None, because the purpose 
of association proxy is to proxy access to an attribute.  If the underlying 
attribute is returning None and that's not an error, then the association proxy 
itself should return None.    I've spent some time trying to figure a 
legitimate error case I'd want raised here, can you provide one ?   Otherwise 
I'm leaning towards having the proxy faithfully proxy out the underlying None 
and I'd backport that at least to 0.8 if not 0.7.   

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to