Exam PCAP All QuestionsBrowse all questions from this exam
Question 103

A property that stores information about a given class's super-classes is named:

    Correct Answer: D

    The property that stores information about a given class's super-classes in Python is '__bases__'. This attribute is a tuple containing references to the base classes. Options like '__upper__', '__super__', and '__ancestors__' do not exist as properties in Python for this purpose.

Discussion
macxszOption: D

D. __bases__ __ancestors__ does not exist

MallieOption: D

Superclasses may be called ancestors, but there is no such property. Answer is D

666_mOption: D

D is correct

seaverickOption: D

http://www.java2s.com/example/python-book/class-bases-attribute.html class rec: pass # Empty namespace object rec.name = 'Bob' # Just objects with attributes rec.age = 40 # ww w . ja v a2 s.c o m d = rec.__bases__ # Class to superclasses link, () in 2.X #d = rec.__ancestors__ #AttributeError: type object 'rec' has no attribute '__ancestors__' #d = rec.__super__ #AttributeError: type object 'rec' has no attribute '__super__' #d = rec.__upper__ #AttributeError: type object 'rec' has no attribute '__upper__' print( d ) ans D

BaldridgeOption: D

D is correct