Closed dongbohu closed 3 weeks ago
The docs explicitly states:
In particular, the purpose is not to have a simple example but to have a pure Python equivalent matching the C implementation (see https://github.com/python/cpython/blob/bffed80230f2617de2ee02bd4bdded1024234dab/Objects/descrobject.c#L1761 and https://github.com/python/cpython/blob/bffed80230f2617de2ee02bd4bdded1024234dab/Objects/descrobject.c#L1572 to understand what happens in C for property.getter
)
Closing as wontfix
.
Documentation
The
Descriptor Guide
Howto implements a sampleProperty
class that is equivalent toproperty
builtin class: https://github.com/python/cpython/blob/bffed80230f2617de2ee02bd4bdded1024234dab/Doc/howto/descriptor.rst?plain=1#L1046I wonder whether the
getter
,setter
anddeleter
methods can be simplified like this:Thanks.