git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [StGit PATCH 1/3] Populate the cached config options with the defaults

From
Karl Wiberg <kha@treskal.com>
Date
Jan 8, 2010, 14:30 UTC
Message-ID
<b8197bcb1001080630i6daad79anf8323f8001d38db3@mail.gmail.com>
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 <catalin.marinas@arm.com> 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
Previous: Catalin MarinasNext: Karl Wiberg
Message 3 of 6 in “Support for command aliases”
  1. 0/3 Support for command aliasesCatalin Marinas, Jan 8, 2010
  2. 1/3 Populate the cached config options with the defaultsCatalin Marinas, Jan 8, 2010
  3. Karl WibergJan 8, 2010
  4. Karl WibergJan 8, 2010
  5. 2/3 Add support for command aliasesCatalin Marinas, Jan 8, 2010
  6. 3/3 Replace some git commands with stg aliases in test scriptsCatalin Marinas, Jan 8, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.