Opened 2 years ago

Closed 2 years ago

#19872 closed Cleanup/optimization (fixed)

cached_property doesn't behave properly when accessed through the class

Reported by: simonpercivall 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 simonpercivall 2 years ago.
test_cached_property.patch (1.3 KB) - added by simonpercivall 2 years ago.
ticket19872.diff (1.8 KB) - added by oinopion 2 years ago.
simonpercival's patches combined

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by simonpercivall

comment:1 Changed 2 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 2 years ago by claudep

  • Component changed from Uncategorized to Core (Other)
  • Needs tests set
  • Type changed from Uncategorized to Cleanup/optimization

Changed 2 years ago by simonpercivall

comment:3 Changed 2 years ago by fhahn

  • Needs tests unset
  • Version changed from 1.4 to master

Changed 2 years ago by oinopion

simonpercival's patches combined

comment:4 Changed 2 years ago by oinopion

  • Triage Stage changed from Accepted to Ready for checkin

I've squashed patches into one.

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

  • Resolution set to fixed
  • Status changed from new to closed

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