Code

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

Download all attachments as: .zip

Change History (8)

Changed 14 months ago by simonpercivall

comment:1 Changed 14 months ago by lukeplant

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

comment:2 Changed 14 months ago by claudep

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

Changed 14 months ago by simonpercivall

comment:3 Changed 14 months ago by fhahn

  • Needs tests unset
  • Version changed from 1.4 to master

Changed 14 months ago by oinopion

simonpercival's patches combined

comment:4 Changed 14 months ago by oinopion

  • Triage Stage changed from Accepted to Ready for checkin

I've squashed patches into one.

comment:5 Changed 14 months 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.