Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
python check if has attribute
Hank D
Programming language:
Python
2021-07-23 03:35:44
0
Q:
python check if 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
python
check
attribute
Related
AttributeError: 'tuple' object has no attribute 'name'
python3 check if object has attribute
myhtmlparser object has no attribute pos python
AttributeError: 'FacetGrid' object has no attribute 'suptitle'
AttributeError: type object 'User' has no attribute 'query'
attribute error python
python check if class has function
New to Communities?
Join the community