Deitel Presents Python Properties
This article describes how to implement properties for a class. Properties are new to the Python language--they were added in version 2.2. Properties enable the programmer to provide access methods on a per-attribute basis. We discuss how to define get, set and delete methods for a private attribute and how to create properties that use these methods to manipulate the attributes. Readers should be familiar with OOP (constructors, the object reference argument, private attributes, class customization) and raising exceptions. The code examples included in this article show readers examples using the Deitel™ signature Live-Code™ Approach.