Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
python3 check if object has attribute
Max Goodridge
Programming language:
Python
2021-04-03 18:28:56
0
Q:
python3 check if object has attribute
snailboat
Code:
Python
2021-07-22 16:13:01
if hasattr(a, 'property'): a.property
6
walterhuang
Code:
Python
2021-01-14 11:03:02
try: doStuff(a.property) except AttributeError: otherStuff()
3
Tags
object
check
attribute
Related
myhtmlparser object has no attribute pos python
AttributeError: 'FacetGrid' object has no attribute 'suptitle'
AttributeError: type object 'User' has no attribute 'query'
python check if has attribute
AttributeError: 'tuple' object has no attribute 'name'
python get object attribute by string
attribute error python
how to check if an object is iterable in python
New to Communities?
Join the community