Python language concepts
We'll introduce a few central concepts of the Python language before looking at more complex examples in later chapters. The first of the central concepts is that everything in Python is an object. Several popular languages have primitive types which escape the object-oriented nature of the language. Python doesn't have this feature. Even simple integers are objects, with defined methods.
Because everything is an object, we're assured of consistent behavior with no special cases. In some languages, the == operator works in one way for primitive types and in another way for objects. Python lacks this divergent behavior. All built-in classes implement the == operator consistently; unless we make specific (and pathological) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access