Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ CID classes
:inherited-members:
:undoc-members:

.. autoclass:: cid.cid._UndefCID
:members:
:undoc-members:

.. autodata:: Undef

.. autoclass:: CIDJSONEncoder
:show-inheritance:
:members:
Expand Down
1 change: 1 addition & 0 deletions newsfragments/68.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document ``Undef`` in the API reference and type stubs.
11 changes: 11 additions & 0 deletions stubs/cid.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class BaseCID:
@property
def buffer(self) -> bytes: ...
def encode(self, encoding: str | None = None) -> bytes: ...
def defined(self) -> bool: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...

Expand All @@ -28,6 +29,16 @@ class CIDv1(BaseCID):
def __init__(self, codec: str, multihash: str | bytes) -> None: ...
def to_v0(self) -> CIDv0: ...

class _UndefCID:
def defined(self) -> bool: ...
def __bool__(self) -> bool: ...
def __repr__(self) -> str: ...
def __str__(self) -> str: ...
def __eq__(self, other: object) -> bool: ...
def __hash__(self) -> int: ...

Undef: _UndefCID

# Function overloads for make_cid
@overload
def make_cid(base58_encoded_multihash: str) -> CIDv0: ...
Expand Down
Loading