Test None for an object that does not implement ==

Ethan Furman ethan at stoneleaf.us
Sun Dec 25 23:27:24 EST 2011


GZ wrote:
> Hi,
> 
> I run into a weird problem. I have a piece of code that looks like the
> following:
> 
> f(...., a=None, c=None):
>     assert  (a==None)==(c==None)


Um -- if you don't want a and c being passed in, why put them in the 
function signature?

~Ethan~



More information about the Python-list mailing list