Opened 17 years ago
Closed 17 years ago
#6590 closed (wontfix)
Change cache.add to cache.setdefault
Reported by: | David Cramer | Owned by: | nobody |
---|---|---|---|
Component: | Core (Cache system) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
Proposal of changing .add to .setdefault before it is adopted. Reason being is consistency.
.add has no clear meaning vs .set
.setdefault is already used for dictionaries
.setdefault clearly states what its doing vs .set
Note:
See TracTickets
for help on using tickets.
Not worth the pain this would cause for everybody using the low-level caching API. "Add" adds a new thing to the cache. The add/set API also corresponds neatly with memcached's API, which is a good idea, since serious caching is going to use memcached and people who are familiar with that shouldn't suddenly have the words changed when looking at a language binding API.