introspection Flashcards
1
Q
function that return class of an object
A
type()
2
Q
function that return class of an object
A
type()
3
Q
attribute of an object that contains class
A
__class__
4
Q
a.__class__.__class__
A
5
Q
attribute of an object that contains class
A
__class__
6
Q
a.__class__.__class__
A
7
Q
function that returns a list of attributes
A
dir(object)
8
Q
get attribute using function
A
getattr(object, attribute_name)
9
Q
if attribute exists
A
hasattr(object, attribute_name)
10
Q
dictionary of global variables
A
globals()
11
Q
dictionary of local variables
A
locals()
12
Q
python library for introspection
A
inspect