Skip to content
Discussion options

You must be logged in to vote

Hey @laenan8466, thanks for your questions!

Docstrings vs. comments

I recently started using an "internal" API layout (see fd500cc):

project/
  src/
    package/
      _internal/
        *.py
      __init__.py  # everything exposed here

Some reasoning on using this layout: https://mkdocstrings.github.io/griffe/guide/users/recommendations/public-apis/#module-layout.

So, now that most modules are internal (private), I enforce that they do not have a docstring, because docstring are meant for users, and users aren't supposed to import from these private modules. Instead, these modules now use comments, because comments are reserved for contributors/maintainers: people working on the code. I…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@laenan8466
Comment options

laenan8466 Mar 6, 2025
Author Sponsor

@pawamoy
Comment options

Answer selected by laenan8466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants