hasattr()

hasattr(object, name)

The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. (This is implemented by calling getattr(object, name) and seeing whether it raises an AttributeError or not.)

doc_python
2016-10-07 17:33:40
Comments
Leave a Comment

Please login to continue.