Sure thing. I read martin fowler's refactoring recently and have been on 
a "make function names clear or hoist things into fns so they become 
more clear" kick :)

On 1/28/14, 18:36, Andrey Petrov wrote:
>
> In urllib3/util/retry.py:
>
> > +        """ Determine whether HTTP response is an error response """
> > +        return self._is_error_response(request_method, response)
> > +
> > +
> > +    def is_exhausted(self):
> > +        """ Determine whether we're out of retry attempts
> > +
> > +        For each of connection errors, read errors (timeouts or bad status
> > +        codes), and redirects, compute the maximum of the specified number of
> > +        errors and the total allowable number of errors (if it was specified),
> > +        and check it against the number of errors we've seen so far.
> > +
> > +        :rtype: bool
> > +        """
> > +
> > +        def _should_apply_total():
>
> Let's avoid making extra closures and function calls when they're not 
> adding anything. Even performance aside, it's just confusing. :)
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/shazow/urllib3/pull/326/files#r9254852>.
>