inheritance and polymorphism Flashcards

1
Q

determine if an object is of specified type

A

isinstance(object, class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

determine if a type is a subclass of another

A

issubclass(type, anotherclass)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

a tuple of base classes of class object

A

__bases__

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

tuple mro of class

A

__mro__

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

get list mro of class

A

mro()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

algorithm for calculating mro

A

c3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what returns super() ?

A

super returns a proxy object which routes method calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

two types of bound proxies

A

class bound instance bound

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

class-bound proxy

A

super(base_class, derived_class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

instance-bound proxy

A

super(class, instance-of-a-class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly