Skip to Content
Advanced Python 3 Programming Techniques
book

Advanced Python 3 Programming Techniques

by Mark Summerfield
February 2009
Intermediate to advanced
68 pages
1h 51m
English
Addison-Wesley Professional
Content preview from Advanced Python 3 Programming Techniques

Chapter 17. Descriptors with Class Decorators

In this section we combine descriptors with class decorators to create a powerful mechanism for creating validated attributes.

Up to now if we wanted to ensure that an attribute was set to only a valid value we have relied on properties (or used getter and setter methods). The disadvantage of such approaches is that we must add validating code for every attribute in every class that needs it. What would be much more convenient and easier to maintain, is ...

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 Network Programming Techniques

Python Network Programming Techniques

Marcel Neidinger
Scientific Computing with Python 3

Scientific Computing with Python 3

Claus Führer, Claus Fuhrer, Jan Erik Solem, Olivier Verdier

Publisher Resources

ISBN: 9780321637727