Skip to Content
Python 3 Object-Oriented Programming - Second Edition
book

Python 3 Object-Oriented Programming - Second Edition

by Dusty Phillips
August 2015
Beginner to intermediate
460 pages
11h 20m
English
Packt Publishing
Content preview from Python 3 Object-Oriented Programming - Second Edition

Dictionaries

Dictionaries are incredibly useful containers that allow us to map objects directly to other objects. An empty object with attributes to it is a sort of dictionary; the names of the properties map to the property values. This is actually closer to the truth than it sounds; internally, objects normally represent attributes as a dictionary, where the values are properties or methods on the objects (see the __dict__ attribute if you don't believe me). Even the attributes on a module are stored, internally, in a dictionary.

Dictionaries are extremely efficient at looking up a value, given a specific key object that maps to that value. They should always be used when you want to find one object based on some other object. The object that ...

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.
Start your free trial

You might also like

Python 3 Object-Oriented Programming - Third Edition

Python 3 Object-Oriented Programming - Third Edition

Dusty Phillips

Publisher Resources

ISBN: 9781784398781Supplemental Content