#4041: cache backends should implement __contains__ so that the in operator may 
be
used
---------------------------------------------------+------------------------
   Reporter:  Gary Wilson <[EMAIL PROTECTED]>  |                Owner:  jacob   
         
     Status:  new                                  |            Component:  
Cache system     
    Version:  SVN                                  |           Resolution:      
             
   Keywords:                                       |                Stage:  
Ready for checkin
  Has_patch:  1                                    |           Needs_docs:  0   
             
Needs_tests:  0                                    |   Needs_better_patch:  0   
             
---------------------------------------------------+------------------------
Comment (by mtredinnick):

 Replying to [comment:5 SmileyChris]:
 > Unless I'm missing something, can't we just do this? (see patch)
 
 Yes, it is possible to make {{{__contains__}}} and {{{has_key}}} be
 aliases for each other like this. In the early days, when
 {{{__contains__}}} was first introduced into the language, it wasn't clear
 if this was going to be a good identification, but nowadays, it's accepted
 as correct; to the point that even Python core checkins are using this
 idiom in places.
 
 What that patch doesn't need is the comment: it's the equivalent of saying
 "add one to i" in a comment. People know what {{{__contains__}}} does
 already.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4041#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to