python class return no name named code example Example: python check namespace has instance if hasattr(a, 'property'): a.property