Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.

Commit 7318ff5

Browse files
committed
introduction for function code in Multihash docstring
1 parent ed1f85a commit 7318ff5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

multihash.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ class Func(Enum):
2626
class Multihash(namedtuple('Multihash', 'func length digest')):
2727
"""A named tuple representing multihash function, length and digest.
2828
29-
The function may be a `Func` member or its integer value (the function
30-
code).
29+
The hash function is a `Func` member:
3130
3231
>>> mh = Multihash(Func.sha1, 20, b'BINARY_DIGEST')
3332
>>> mh == (Func.sha1, 20, b'BINARY_DIGEST')
3433
True
3534
>>> mh == (mh.func, mh.length, mh.digest)
3635
True
3736
37+
Although it can also be its integer value (the function code):
38+
3839
>>> mhfc = Multihash(Func.sha1.value, mh.length, mh.digest)
3940
>>> mhfc == mh
4041
True

0 commit comments

Comments
 (0)