i'm looking find convention on returning fail function if function fails. typically return none or false in case, function's purpose read io, bool (true/false), int or float.
so in case can't return false. i've tried use none don't know if best case cause if don't check return call function none output might recognized false output.
i thinking having definition files has string tokens, seems in efficient have parse string.
are there built-in objects available? whats convention?
you should raise exception if function fails. not practice have check if return value invalid per eafp principle of python.
easier ask forgiveness permission. common python coding style assumes existence of valid keys or attributes , catches exceptions if assumption proves false. clean , fast style characterized presence of many try , except statements. technique contrasts lbyl style common many other languages such c.
Comments
Post a Comment