Opened 4 years ago

Closed 4 years ago

#19872 closed Cleanup/optimization (fixed)

cached_property doesn't behave properly when accessed through the class

Reported by: Simon Percivall Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

cached_property raises an exception when used through the class, instead of returning self like property does. This makes introspection hard, and makes its use together with ABC's impossible.

Attachments (3)

cached_property.patch (510 bytes) - added by Simon Percivall 4 years ago.
test_cached_property.patch (1.3 KB) - added by Simon Percivall 4 years ago.
ticket19872.diff (1.8 KB) - added by Tomek Paczkowski 4 years ago.
simonpercival's patches combined

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by Simon Percivall

Attachment: cached_property.patch added

comment:1 Changed 4 years ago by Luke Plant

Triage Stage: UnreviewedAccepted

comment:2 Changed 4 years ago by Claude Paroz

Component: UncategorizedCore (Other)
Needs tests: set
Type: UncategorizedCleanup/optimization

Changed 4 years ago by Simon Percivall

Attachment: test_cached_property.patch added

comment:3 Changed 4 years ago by fhahn

Needs tests: unset
Version: 1.4master

Changed 4 years ago by Tomek Paczkowski

Attachment: ticket19872.diff added

simonpercival's patches combined

comment:4 Changed 4 years ago by Tomek Paczkowski

Triage Stage: AcceptedReady for checkin

I've squashed patches into one.

comment:5 Changed 4 years ago by Tomek Paczkowski <tomek@…>

Resolution: fixed
Status: newclosed

In b88abd684041ffa66bfe445e1ac26164e803d488:

Fixed #19872

Made cached_property to behave as property when accessed via class.

Note: See TracTickets for help on using tickets.
Back to Top