#36763: Small code refactoring in TemplateDoesNotExist.__init__
-------------------------------------+-------------------------------------
               Reporter:  Pravin     |          Owner:  Pravin
                   Type:             |         Status:  assigned
  Cleanup/optimization               |
              Component:  Template   |        Version:  5.2
  system                             |       Keywords:
               Severity:  Normal     |  TemplateDoesNotExist
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I noticed {{{TemplateDoesNotExist.__init__}}} could be made more readable
 and more clear.
 Instead of this
 {{{
     def __init__(self, msg, tried=None, backend=None, chain=None):
         self.backend = backend
         if tried is None:
             tried = []
         self.tried = tried
         if chain is None:
             chain = []
         self.chain = chain
         super().__init__(msg)

 }}}

 This could have been more simple, clear and readable like this
 {{{
     def __init__(self, msg, tried=None, backend=None, chain=None):
         self.backend = backend
         self.tried   = tried if tried else []
         self.chain   = chain if chain else []
         super().__init__(msg)

 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36763>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019add178453-c539f444-63a0-4b8a-bbf2-f894c28a8ae3-000000%40eu-central-1.amazonses.com.

Reply via email to