Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78055a8

Browse files
committed
Pick a consistent type for __all__ (for now, list)
This makes all __all__ everywhere in the git package lists. Before,roughly half were lists and half were tuples. There are reasonabletheoretical arguments for both, and in practice all tools todaysupport both. Traditionally using a list is far more common, and itremains at least somewhat more common. Furthermore, git/util.pyuses a list and is currently written to append an element to itthat is conditionally defined on Windows (though it would probablybe fine for that to be the only list, since it reflects an actualrelevant difference about it).The goal here is just to remove inconsistency that does not signifyanything and is the result of drift over time. If a reason (evenpreference) arises to make them all tuples in the future, then thatis also probably fine.
1 parentfcc7418 commit78055a8

19 files changed

+24
-24
lines changed

‎git/cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from __future__importannotations
77

8-
__all__=("Git",)
8+
__all__=["Git"]
99

1010
importcontextlib
1111
importio

‎git/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""Parser for reading and writing configuration files."""
77

8-
__all__=("GitConfigParser","SectionConstraint")
8+
__all__=["GitConfigParser","SectionConstraint"]
99

1010
importabc
1111
importconfigparserascp

‎git/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""Module with our own gitdb implementation - it uses the git command."""
55

6-
__all__=("GitCmdObjectDB","GitDB")
6+
__all__=["GitCmdObjectDB","GitDB"]
77

88
fromgitdb.baseimportOInfo,OStream
99
fromgitdb.dbimportGitDB,LooseObjectDB

‎git/diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
__all__=("DiffConstants","NULL_TREE","INDEX","Diffable","DiffIndex","Diff")
6+
__all__=["DiffConstants","NULL_TREE","INDEX","Diffable","DiffIndex","Diff"]
77

88
importenum
99
importre

‎git/index/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""Module containing :class:`IndexFile`, an Index implementation facilitating all kinds
77
of index manipulations such as querying and merging."""
88

9-
__all__=("IndexFile","CheckoutError","StageType")
9+
__all__=["IndexFile","CheckoutError","StageType"]
1010

1111
importcontextlib
1212
importdatetime

‎git/index/fun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""Standalone functions to accompany the index implementation and make it more
55
versatile."""
66

7-
__all__=(
7+
__all__=[
88
"write_cache",
99
"read_cache",
1010
"write_tree_from_cache",
@@ -13,7 +13,7 @@
1313
"S_IFGITLINK",
1414
"run_commit_hook",
1515
"hook_path",
16-
)
16+
]
1717

1818
fromioimportBytesIO
1919
importos

‎git/index/typ.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""Additional types used by the index."""
55

6-
__all__=("BlobFilter","BaseIndexEntry","IndexEntry","StageType")
6+
__all__=["BlobFilter","BaseIndexEntry","IndexEntry","StageType"]
77

88
frombinasciiimportb2a_hex
99
frompathlibimportPath

‎git/index/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"""Index utilities."""
55

6-
__all__=("TemporaryFileSwap","post_clear_cache","default_index","git_working_dir")
6+
__all__=["TemporaryFileSwap","post_clear_cache","default_index","git_working_dir"]
77

88
importcontextlib
99
fromfunctoolsimportwraps

‎git/objects/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
__all__=("Object","IndexObject")
6+
__all__=["Object","IndexObject"]
77

88
importos.pathasosp
99

‎git/objects/blob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
__all__=("Blob",)
6+
__all__=["Blob"]
77

88
frommimetypesimportguess_type
99
importsys

‎git/objects/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
__all__=("Commit",)
6+
__all__=["Commit"]
77

88
fromcollectionsimportdefaultdict
99
importdatetime

‎git/objects/fun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
"""Functions that are supposed to be as fast as possible."""
55

6-
__all__=(
6+
__all__=[
77
"tree_to_stream",
88
"tree_entries_from_data",
99
"traverse_trees_recursive",
1010
"traverse_tree_recursive",
11-
)
11+
]
1212

1313
fromstatimportS_ISDIR
1414

‎git/objects/submodule/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# This module is part of GitPython and is released under the
22
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
33

4-
__all__=(
4+
__all__=[
55
"sm_section",
66
"sm_name",
77
"mkhead",
88
"find_first_remote_branch",
99
"SubmoduleConfigParser",
10-
)
10+
]
1111

1212
fromioimportBytesIO
1313
importweakref

‎git/objects/tag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
For lightweight tags, see the :mod:`git.refs.tag` module.
1010
"""
1111

12-
__all__=("TagObject",)
12+
__all__=["TagObject"]
1313

1414
importsys
1515

‎git/objects/tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
__all__=("TreeModifier","Tree")
6+
__all__=["TreeModifier","Tree"]
77

88
importsys
99

‎git/objects/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""Utility functions for working with git objects."""
77

8-
__all__=(
8+
__all__=[
99
"get_object_type_by_name",
1010
"parse_date",
1111
"parse_actor_and_date",
@@ -17,7 +17,7 @@
1717
"Actor",
1818
"tzoffset",
1919
"utc",
20-
)
20+
]
2121

2222
fromabcimportABC,abstractmethod
2323
importcalendar

‎git/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"""Module implementing a remote object allowing easy access to git remotes."""
77

8-
__all__=("RemoteProgress","PushInfo","FetchInfo","Remote")
8+
__all__=["RemoteProgress","PushInfo","FetchInfo","Remote"]
99

1010
importcontextlib
1111
importlogging

‎git/repo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from __future__importannotations
77

8-
__all__=("Repo",)
8+
__all__=["Repo"]
99

1010
importgc
1111
importlogging

‎git/repo/fun.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from __future__importannotations
77

8-
__all__=(
8+
__all__=[
99
"rev_parse",
1010
"is_git_dir",
1111
"touch",
@@ -15,7 +15,7 @@
1515
"deref_tag",
1616
"to_commit",
1717
"find_worktree_git_dir",
18-
)
18+
]
1919

2020
importos
2121
importos.pathasosp

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp