In Perl, it\'s often nice to be able to assign an object, but specify some fall-back value if the variable being assigned from is \'undef\'. For instance:
I think this would help, since the problem comes down to check whether a variable is defined or not:
Easy way to check that variable is defined in python?