hasattr
consthasattr: (obj:unknown,name:string) =>boolean=builtins.hasattr
Defined in: packages/pythonlib/src/index.ts:194
Python hasattr() function - check if an object has an attribute
Parameters
| Parameter | Type | Description |
|---|---|---|
obj | unknown | The object to check |
name | string | The name of the attribute |
Returns
boolean
True if the attribute exists, false otherwise