Opened 11 years ago

Closed 11 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: dev
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 11 years ago.
test_cached_property.patch (1.3 KB ) - added by Simon Percivall 11 years ago.
ticket19872.diff (1.8 KB ) - added by Tomek Paczkowski 11 years ago.
simonpercival's patches combined

Download all attachments as: .zip

Change History (8)

by Simon Percivall, 11 years ago

Attachment: cached_property.patch added

comment:1 by Luke Plant, 11 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Claude Paroz, 11 years ago

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

by Simon Percivall, 11 years ago

Attachment: test_cached_property.patch added

comment:3 by fhahn, 11 years ago

Needs tests: unset
Version: 1.4master

by Tomek Paczkowski, 11 years ago

Attachment: ticket19872.diff added

simonpercival's patches combined

comment:4 by Tomek Paczkowski, 11 years ago

Triage Stage: AcceptedReady for checkin

I've squashed patches into one.

comment:5 by Tomek Paczkowski <tomek@…>, 11 years ago

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