Skip to content

Commit 8543457

Browse files
committed
Use :const: for constants that had the :attr: role
Note that this intentionally does *not* include some all-caps class attributes that are not really constants: - Git.GIT_PYTHON_GIT_EXECUTABLE is set by refresh functions, including on subsequent calls, which is an important and documented part of what those functions do. (Also, it is set automatically from an enviroment variable, which is not constant across runs; that it could not even in principle be replaced by a specific literal value is a further reason it is not a constant.) - The Git.USE_SHELL attribute is a more ambiguous case. It is given a literal value (False) which it preferably remains. But setting it has been documented as something users can do (in the changelog, and later in regard to setting it being a deprecated operation). The first of these is decisively not a constant even under a loose definition, while the second is less clear. I've kept both with the :attr: role.
1 parent ca95c42 commit 8543457

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

git/remote.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ def push(
11771177
individual head which had been updated on the remote side.
11781178
11791179
If the push contains rejected heads, these will have the
1180-
:attr:`PushInfo.ERROR` bit set in their flags.
1180+
:const:`PushInfo.ERROR` bit set in their flags.
11811181
11821182
If the operation fails completely, the length of the returned
11831183
:class:`PushInfoList` will be 0.

git/util.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -713,14 +713,14 @@ def update(
713713
:param op_code:
714714
Integer allowing to be compared against Operation IDs and stage IDs.
715715
716-
Stage IDs are :attr:`BEGIN` and :attr:`END`. :attr:`BEGIN` will only be set
717-
once for each Operation ID as well as :attr:`END`. It may be that
718-
:attr:`BEGIN` and :attr:`END` are set at once in case only one progress
719-
message was emitted due to the speed of the operation. Between :attr:`BEGIN`
720-
and :attr:`END`, none of these flags will be set.
716+
Stage IDs are :const:`BEGIN` and :const:`END`. :const:`BEGIN` will only be
717+
set once for each Operation ID as well as :const:`END`. It may be that
718+
:const:`BEGIN` and :const:`END` are set at once in case only one progress
719+
message was emitted due to the speed of the operation. Between
720+
:const:`BEGIN` and :const:`END`, none of these flags will be set.
721721
722-
Operation IDs are all held within the :attr:`OP_MASK`. Only one Operation ID
723-
will be active per call.
722+
Operation IDs are all held within the :const:`OP_MASK`. Only one Operation
723+
ID will be active per call.
724724
725725
:param cur_count:
726726
Current absolute count of items.
@@ -730,7 +730,7 @@ def update(
730730
maximum number of items or if it is (yet) unknown.
731731
732732
:param message:
733-
In case of the :attr:`WRITING` operation, it contains the amount of bytes
733+
In case of the :const:`WRITING` operation, it contains the amount of bytes
734734
transferred. It may possibly be used for other purposes as well.
735735
736736
:note:

0 commit comments

Comments
 (0)