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

[StGit PATCH 2/2] Use the builtin set() instead of sets.Set()

From
Karl Hasselström <kha@treskal.com>
Date
Sep 3, 2007, 21:48 UTC
Message-ID
<20070903214851.18057.89136.stgit@yoghurt>
In-Reply-To
<20070903214545.18057.79301.stgit@yoghurt>
We can do that now that we're guaranteed to have Python 2.4 or later.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 stgit/git.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index 8857209..4b4c626 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -26,7 +26,6 @@ from stgit.utils import *
 from stgit.out import *
 from stgit.run import *
 from stgit.config import config
-from sets import Set
 
 # git exception class
 class GitException(Exception):
@@ -959,10 +958,9 @@ def __remotes_from_dir(dir):
 def remotes_list():
     """Return the list of remotes in the repository
     """
-
-    return Set(__remotes_from_config()) | \
-           Set(__remotes_from_dir('remotes')) | \
-           Set(__remotes_from_dir('branches'))
+    return (set(__remotes_from_config())
+            | set(__remotes_from_dir('remotes'))
+            | set(__remotes_from_dir('branches')))
 
 def remotes_local_branches(remote):
     """Returns the list of local branches fetched from given remote
Previous: Karl Hasselström
Message 14 of 14 in “Clean up subprocess calling”
  1. 0/4 Clean up subprocess callingKarl Hasselström, Aug 26, 2007
  2. 1/4 Refactor output handling to break circular dependencyKarl Hasselström, Aug 26, 2007
  3. 2/4 Refactor subprocess creationKarl Hasselström, Aug 26, 2007
  4. 3/4 Assert that the argument to Run is a sequence of stringsKarl Hasselström, Aug 26, 2007
  5. 4/4 Add optional logging of subprocess executionKarl Hasselström, Aug 26, 2007
  6. Catalin MarinasAug 29, 2007
  7. Karl HasselströmAug 29, 2007
  8. Karl HasselströmAug 29, 2007
  9. Catalin MarinasSep 3, 2007
  10. Catalin MarinasSep 3, 2007
  11. Karl HasselströmSep 3, 2007
  12. 0/2 Break Python 2.3 compatibilityKarl Hasselström, Sep 3, 2007
  13. 1/2 Use subprocess.Popen to call git executablesKarl Hasselström, Sep 3, 2007
  14. 2/2 Use the builtin set() instead of sets.Set()Karl Hasselström, Sep 3, 2007

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.