From: Karl Wiberg Date: Fri, 08 Jan 2010 14:30:48 GMT Subject: Re: [StGit PATCH 1/3] Populate the cached config options with the defaults Message-ID: In-Reply-To: <20100108123559.24161.14842.stgit@pc1117.cambridge.arm.com> Hmm. What's the point of this rewrite? On Fri, Jan 8, 2010 at 1:35 PM, Catalin Marinas wrote: > +        try: > +            return self.__cache[name][-1] > +        except KeyError: > +            return None You could write this as return self.__cache.get(name, [None])[-1] -- Karl Wiberg, kha@treskal.com subrabbit.wordpress.com www.treskal.com/kalle