From 9743e63e00d275830c6e017cc8f8563f374305db Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 20 Jun 2023 07:50:24 +0200 Subject: [PATCH] docs: mention `@private` --- pdoc/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pdoc/__init__.py b/pdoc/__init__.py index dd1c6e59..5c097e92 100644 --- a/pdoc/__init__.py +++ b/pdoc/__init__.py @@ -180,13 +180,14 @@ class GoldenRetriever(Dog): - If `__all__` is defined in the module, then all identifiers in that list will be considered public. No other identifiers will be considered public. - If `__all__` is not defined, then pdoc will consider all members public that - 1. do not start with an underscore + 1. do not start with an underscore, + 2. don't have `@private` in their docstring, 2. and are defined in the current module (i.e. they are not imported). In general, we recommend keeping these conventions: - If you want to document a private member, consider making it public. -- If you want to hide a public member, consider making it private. +- If you want to hide a public member, consider making it private or add `@private` to their docstring, - If you want to document a special `__dunder__` method, the recommended way to do so is to not document the dunder method specifically, but to add some usage examples in the class documentation.