Comment on How many lines of Java would this take?Comments−brehaut16yThe snippet is imprecise. it should be something like 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−ighostOP16yThis function doesn't implement the same functionality. It doesn't even take the same arguments.−brehaut16yyou are quite right. it looks totally different to when i first checked it, so yes, ignore me.
Comments
The snippet is imprecise. it should be something like
This function doesn't implement the same functionality. It doesn't even take the same arguments.
you are quite right. it looks totally different to when i first checked it, so yes, ignore me.