Python Language Concepts: Create Properties to Implement Getters, Setters, and Deleters

Start Course
level
Introductory
Subject
Software Development
Course Length
24 minutes
Subscription
Foundation

Course Description

In this course, we'll look at how the property function works in Python and some compelling reasons to use it. This built-in function allows you to take increased control over class attributes. Rather than defining a simple attribute on a class that can be accessed or modified at any time, you can create getter and setter methods that control access to that attribute in whatever way you like. This all happens without changing the syntax for accessing or modifying the attribute.

Requirements

  • Students should already be comfortable with Python language fundamentals, including: writing and using classes, methods, and functions, using container objects (e.g., list or dictionary), using decorators, using string formatting, using conditional operators

Instructors

Michael Dougherty

Michael Dougherty is an experienced full-stack engineer, functional programming aficionado, and musician. When he was 13 he brought a "Learn C++ in 21 days" book with him on a family vacation, and he has been writing code ever since. For the past few years, Michael has worked as a Web Development Mentor, as a Full Stack Senior Software Engineer, as well as on several side projects.