#4050: django/db/models/base.py uses inefficient subclass check
---------------------------------------------------------+------------------
   Reporter:  Ludvig Ericson <[EMAIL PROTECTED]>  |                Owner:  
adrian          
     Status:  new                                        |            
Component:  Database wrapper
    Version:  SVN                                        |           
Resolution:                  
   Keywords:  issubclass models base.py                  |                
Stage:  Unreviewed      
  Has_patch:  1                                          |           
Needs_docs:  0               
Needs_tests:  0                                          |   
Needs_better_patch:  1               
---------------------------------------------------------+------------------
Comment (by Michael Radziej <[EMAIL PROTECTED]>):

 Replying to [comment:6 anonymous]:
 > It will be not None when the loop exits, since python - intentionally -
 leaks the variable into the containing scope.
 
 You're right. But it would be much clearer without break, wouldn't it?
 
 {{{
 for base in bases:
   if issubclass(base, Model):
     return ...
 }}}
 
 I really don't like this leaking out, but perhaps it's a matter of taste
 ;-)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4050#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