Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/bpython/bpython
/ hasattr_safe
Function
hasattr_safe
bpython/inspection.py:396–401 ·
view source on GitHub ↗
(obj: Any, name: str)
Source
from the content-addressed store, hash-verified
394
395
396
def
hasattr_safe(obj: Any, name: str) -> bool:
397
try
:
398
getattr_safe(obj, name)
399
return
True
400
except
AttributeError:
401
return
False
Callers
1
_getpydocspec
Function · 0.85
Calls
1
getattr_safe
Function · 0.85
Tested by
no test coverage detected