June 2019
Beginner to intermediate
770 pages
19h 24m
English
We may have multiple implementations for a given class or module. We'll often use a configuration file parameter to decide which implementation is appropriate. See Chapter 14, Configuration Files and Persistence, for more information on this technique.
In some cases, however, an application may silently depend on whether or not other packages are part of the Python installation. One implementation may be optimal, and another implementation may be the fallback plan. This is used by a number of Python library modules to choose between optimized binary modules and pure Python modules.
A common technique is to try multiple import alternatives to locate a package that's installed. We can produce warnings ...
Read now
Unlock full access