To call a protected property on an instance of a class in Python, you can use the single underscore convention.
If a class has a protected property named _my_protected_prop
, you can access it from an instance of the class like this:
main.py182 chars7 lines
Note that this isn't truly protected in the sense that other modules could still access this property, but it is generally accepted as a convention not to access these properties from outside the class.
gistlibby LogSnag