Who Can Access My Data?
Learn about the fundamental principles of object-oriented programming and its key elements, including methods and properties.
We'll cover the following...
Most object-oriented programming languages have a concept of access control. This is related to abstraction. Some attributes and methods on an object are marked private, meaning only that object can access them. Others are marked protected, meaning only that class and any subclasses have access. The rest are public, meaning any other object is allowed to access them.
Access of data in Python
Python doesn’t do this. Python doesn’t really believe in enforcing laws that might someday get in our way. Instead, it provides unenforced guidelines and best practices. Technically, all methods and attributes on a class are publicly available. If we want to suggest that a method should not be used publicly, we can put ...