Steven D'Aprano wrote:
I'm sure you realise that that snippet needlessly recalculates any cached result that happens to be false, but others reading might not.
I only use it as written when I'm dealing with types that don't have false values. If I did need to cache such a type, I would use a different test, such as 'if y is None'. -- Greg -- http://mail.python.org/mailman/listinfo/python-list