as programming languagepython provides great deal of latitude in regard to the specification of an interface python has tradition of treating abstractions implicitly using mechanism known as duck typing as an interpreted and dynamically typed languagethere is no "compile timechecking of data types in pythonand no formal requirement for declarations of abstract base classes instead programmers assume that an object supports set of known behaviorswith the interpreter raising run-time error if those assumptions fail the description of this as "duck typingcomes from an adage attributed to poet james whitcomb rileystating that "when see bird that walks like duck and swims like duck and quacks like ducki call that bird duck more formallypython supports abstract data types using mechanism known as an abstract base class (abcan abstract base class cannot be instantiated ( you cannot directly create an instance of that class)but it defines one or more common methods that all implementations of the abstraction must have an abc is realized by one or more concrete classes that inherit from the abstract base class while providing implementations for those method declared by the abc python' abc module provides formal support for abcsalthough we omit such declarations for simplicity we will make use of several existing abstract base classes coming from python' collections modulewhich includes definitions for several common data structure adtsand concrete implementations of some of those abstractions encapsulation another important principle of object-oriented design is encapsulation different components of software system should not reveal the internal details of their respective implementations one of the main advantages of encapsulation is that it gives one programmer freedom to implement the details of componentwithout concern that other programmers will be writing code that intricately depends on those internal decisions the only constraint on the programmer of component is to maintain the public interface for the componentas other programmers will be writing code that depends on that interface encapsulation yields robustness and adaptabilityfor it allows the implementation details of parts of program to change without adversely affecting other partsthereby making it easier to fix bugs or add new functionality with relatively local changes to component throughout this bookwe will adhere to the principle of encapsulationmaking clear which aspects of data structure are assumed to be public and which are assumed to be internal details with that saidpython provides only loose support for encapsulation by conventionnames of members of class (both data members and member functionsthat start with single underscore character ( secretare assumed to be nonpublic and should not be relied upon those conventions are reinforced by the intentional omission of those members from automatically generated documentation