Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

#11693 closed defect (fixed)

Methods decorated with lazy do not look like data descriptors

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.2
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:

Modified lazy class so that the decorated attributes act as data descriptors.

Internal Changes:

Description

The lazy class doesn't implement the __set__ method, so it doesn't look like a data descriptor. This was discussed in #11684.

In implementing the __set__ method, we need to decide whether methods decorated with lazy should behave like read-only properties. Another approach would be to add a lazyproperty class for lazily-evaluated attributes that should be readonly.

Attachments (0)

Change History (3)

comment:1 by Ryan J Ollos, 10 years ago

There is at least one assignment to an attribute decorated with lazy: trunk/trac/web/main.py@12922:536#L531. That would suggest that we shouldn't change the behaviour (at least on 1.0-stable).

comment:2 by Ryan J Ollos, 10 years ago

Owner: set to Ryan J Ollos
Status: newassigned

Proposed changes in log:rjollos.git:t11693.

comment:3 by Ryan J Ollos, 10 years ago

API Changes: modified (diff)
Milestone: 1.0.31.0.2
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [13046], merged to trunk in [13047].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.