def safe_length(var):
output = -<NUM_LIT:1><EOL>try:<EOL><INDENT>output = len(var)<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>return output<EOL>
Exception-safe length check, returns -1 if no length on type or error