79448411

Date: 2025-02-18 13:28:18
Score: 3
Natty:
Report link

The answer is that a property's getter and setter are invoked only from an instance.

The example that demonstrates this is within https://stackoverflow.com/a/7118013/1496279 .

> print Bar.x
> # < property object at 0x04D37270> 
> print Bar () .x
> # 0

The ( ) creates an instance.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user15972