Skip to main content
Top

Hint

Swipe to navigate through the chapters of this book

2019 | OriginalPaper | Chapter

23. Python Properties

share
SHARE

Abstract

Many object-oriented languages have the explicit concept of encapsulation; that is the ability to hide data within an object and only to provide specific gateways into that data. These gateways are methods defined to get or set the value of an attribute (often referred to as getters and setters). This allows more control over access to the data; for example, it is possible to check that only a positive integer above zero, but below 120, is used for a person’s age etc.
Metadata
Title
Python Properties
Author
John Hunt
Copyright Year
2019
DOI
https://doi.org/10.1007/978-3-030-20290-3_23

Premium Partner