2 Chapter 10, Object-Oriented Programming
a. Classes are new function types.
b. Most applications you’ll build for your own use will commonly use either no
custom classes or just a few.
c. You can contribute your custom classes to the Python open-source community,
but you are not obligated to do so. Organizations often have policies and proce-
dures related to open-sourcing code.
d. All of the above statements are true.
10.1 Q5: Which of the following statements is false?
a. New classes can be formed quickly through inheritance and composition from
classes in abundant class libraries.
b. Eventually, software will be constructed predominantly from standardized, re-
usable components, just as hardware is constructed from interchangeable parts
today. This will help meet the challenges of developing ever more powerful soft-
ware.
c. When creating a new class, instead of writing all new code, you can designate
that the new class is to be formed initially by inheriting the attributes and meth-
ods of a previously defined base class (also called a subclass) and the new class is
called a derived class (or superclass).
d. After inheriting, you then customize the derived class to meet the specific needs
of your application. To minimize the customization effort, you should always try
to inherit from the base class that’s closest to your needs.
10.1 Q6: Which of the following statements a), b) or c) is false?
a. Polymorphism enables you to conveniently program “in the general” rather
than “in the specific.”
b. With polymorphism, you simply send the same method call to objects possibly
of many different types. Each object responds by “doing the right thing” for ob-
jects of its type. So the same method call takes on many forms, hence the term
“poly–morphism.”
c. In Python, as in other major object-oriented programming languages, you can
implement polymorphism only via inheritance.
d. All of the above statements are true.