Opened 10 years ago
Closed 10 years ago
#25611 closed Cleanup/optimization (fixed)
Use a common descriptor signature
| Reported by: | Tim Graham | 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
Currently we have several different signatures for descriptor methods __get__() and __set__():
Curtis proposed:
- "instance_type" is explicit
- "cls" is a common convention for passing a class
- "owner" is in the docs {but so are others}
- and "type" I think is a bit confusing...
So... my preference, upon reflection, would be: def __get__(self, instance, cls=None)
This got several +1s on the mailing list.
Change History (3)
comment:1 by , 10 years ago
| Has patch: | set |
|---|
comment:2 by , 10 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
PR