Returns true if the given object has a method with the given name. :param arg: the object :param method: the method name :type method: string :rtype: bool
(arg, method)
| 193 | |
| 194 | |
| 195 | def _has_method(arg, method): |
| 196 | """Returns true if the given object has a method with the given name. |
| 197 | |
| 198 | :param arg: the object |
| 199 | |
| 200 | :param method: the method name |
| 201 | :type method: string |
| 202 | |
| 203 | :rtype: bool |
| 204 | """ |
| 205 | return hasattr(arg, method) and callable(getattr(arg, method)) |
| 206 | |
| 207 | |
| 208 | def components(arg): |