Skip to content

Commit 1530fd2

Browse files
committed
Use phrases like "git object type" where applicable
In some recently introduced or expanded docstrings, I had overused phrases like "kind of git object" with the hope of avoiding confusion with the meanings of "type" relevant to Python (i.e., "class" or "static type"). But this made the relationship to git's own notion of "object type" less clear than it could be, especially in docstrings that also included links to the gitglossary(7) entry for "object type" (because those links' relevance was less clear). This dials back the use of "kind" to where I am more confident that it is clarifying or at least not confusing.
1 parent 7166703 commit 1530fd2

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

git/objects/base.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838

3939
class Object(LazyMixin):
40-
"""Base class for classes representing kinds of git objects.
40+
"""Base class for classes representing git object types.
4141
4242
The following leaf classes represent specific kinds of git objects:
4343
@@ -61,7 +61,7 @@ class Object(LazyMixin):
6161
:note:
6262
:class:`~git.objects.submodule.base.Submodule` is defined under the hierarchy
6363
rooted at this :class:`Object` class, even though submodules are not really a
64-
kind of git object.
64+
type of git object.
6565
6666
"""
6767

@@ -78,7 +78,7 @@ class Object(LazyMixin):
7878
__slots__ = ("repo", "binsha", "size")
7979

8080
type: Union[Lit_commit_ish, None] = None
81-
"""String identifying (a concrete :class:`Object` subtype for) a kind of git object.
81+
"""String identifying (a concrete :class:`Object` subtype for) a git object type.
8282
8383
The subtypes that this may name correspond to the kinds of git objects that exist,
8484
i.e., the objects that may be present in a git repository.
@@ -87,7 +87,7 @@ class Object(LazyMixin):
8787
Most subclasses represent specific types of git objects and override this class
8888
attribute accordingly. This attribute is ``None`` in the :class:`Object` base
8989
class, as well as the :class:`IndexObject` intermediate subclass, but never
90-
``None`` in concrete leaf subclasses representing specific kinds of git objects.
90+
``None`` in concrete leaf subclasses representing specific git object types.
9191
9292
:note:
9393
See also :class:`~git.types.Commit_ish`.
@@ -214,9 +214,10 @@ def stream_data(self, ostream: "OStream") -> "Object":
214214
class IndexObject(Object):
215215
"""Base for all objects that can be part of the index file.
216216
217-
The classes representing kinds of git objects that can be part of the index file are
217+
The classes representing git object types that can be part of the index file are
218218
:class:`~git.objects.tree.Tree and :class:`~git.objects.blob.Blob`. In addition,
219-
:class:`~git.objects.submodule.base.Submodule` is also a subclass.
219+
:class:`~git.objects.submodule.base.Submodule`, which is not really a git object
220+
type but can be part of an index file, is also a subclass.
220221
"""
221222

222223
__slots__ = ("path", "mode")

git/types.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"""
6868

6969
Commit_ish = Union["Commit", "TagObject", "Blob", "Tree"]
70-
"""Union of the :class:`~git.objects.base.Object`-based types that represent kinds of
71-
git objects. This union is often usable where a commit-ish is expected, but is not
72-
actually limited to types representing commit-ish git objects.
70+
"""Union of the :class:`~git.objects.base.Object`-based types that represent git object
71+
types. This union is often usable where a commit-ish is expected, but is not actually
72+
limited to types representing commit-ish git objects.
7373
7474
See gitglossary(7) on:
7575
@@ -93,7 +93,7 @@
9393

9494
Lit_commit_ish = Literal["commit", "tag", "blob", "tree"]
9595
"""Literal strings identifying concrete :class:`~git.objects.base.Object` subtypes
96-
representing kinds of git objects.
96+
representing git object types.
9797
9898
See the :class:`Object.type <git.objects.base.Object.type>` attribute.
9999

0 commit comments

Comments
 (0)