The snippet is imprecise. it should be something like<p><pre><code>    def hasmethod(obj, meth_name):
        """If it calls like a method it's a method."""
        
        return callable(getattr(obj, meth_name)) if hasattr(obj, meth_name) else False</code></pre>