Skip to content

Document calling a command as a regular function - #3820

Open
kdeldycke wants to merge 1 commit into
pallets:stablefrom
kdeldycke:command-as-function-faq
Open

Document calling a command as a regular function#3820
kdeldycke wants to merge 1 commit into
pallets:stablefrom
kdeldycke:command-as-function-faq

Conversation

@kdeldycke

Copy link
Copy Markdown
Collaborator

Document an old open issue on how to call a command as a regular function.

Closes #1054.

@kdeldycke kdeldycke linked an issue Aug 31, 2026 that may be closed by this pull request
@kdeldycke kdeldycke added the docs Updates to documentation, readme, docstrings, typos label Aug 31, 2026
@kdeldycke kdeldycke added this to the 8.5.1 milestone Aug 31, 2026
Comment thread docs/faqs.md Outdated
@davidism

davidism commented Sep 1, 2026

Copy link
Copy Markdown
Member

I'm not sure I want to document calling callback directly. It feels like an internal implementation detail. I think the other strategies are sufficient.

@Rowlando13

Copy link
Copy Markdown
Member

If it's an implementation detail we should document as private and deprecate public api in the next feature release.

@kdeldycke
kdeldycke force-pushed the command-as-function-faq branch from 18924fd to bb86cde Compare September 1, 2026 22:46
@kdeldycke

Copy link
Copy Markdown
Collaborator Author

I'm not sure I want to document calling callback directly. It feels like an internal implementation detail. I think the other strategies are sufficient.

Removed in https://github.com/pallets/click/compare/18924fda3f3369c060ca12b53ba60aba1300def5..bb86cdea6e83bc8e2711290eeffb4c8654baa7a3 .

Now what do you think of @Rowlando13 proposition to make it a private method and deprecate it?

@davidism

davidism commented Sep 1, 2026

Copy link
Copy Markdown
Member

We don't need to go that far, it's fine that it's accessible as "the thing the command calls", but we don't need to promote it as a thing to call directly.

@kdeldycke

Copy link
Copy Markdown
Collaborator Author

We don't need to go that far, it's fine that it's accessible as "the thing the command calls", but we don't need to promote it as a thing to call directly.

OK good, so this PR is ready to be merged upstream! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Updates to documentation, readme, docstrings, typos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use function both as API and click function?

3 participants