September 2026
1051 pages
35h 4m
English
Python is a dynamically typed language. This means that the data type assigned to an instance isn’t determined before the program is executed. Interfaces are also often implicitly defined by the capabilities of an instance, rather than by the data type; this principle is referred to as duck typing (see Chapter 19, Section 19.11.3). For example, there are many functions and methods in the standard library that expect a file-like object, an object that provides an interface for writing and reading data. However, two file-like objects can have completely different data types.
This flexibility is one of Python's great strengths, but it also leads to the fact that which data types fulfill the requirements of ...
Read now
Unlock full access