Skip to content

feat: ✨ Allow for functools.partial and functions returning an awaitable as autocomplete #2669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Paillat-dev
Copy link
Contributor

@Paillat-dev Paillat-dev commented Dec 12, 2024

Summary

Allows usage of functions with any number of optional parameters as autocomplete. This allows by extent the usage of partials and similar as autocomplete.

Fixes #2668

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Paillat-dev Paillat-dev requested a review from a team as a code owner December 12, 2024 22:10
@pullapprove4 pullapprove4 bot requested a review from Middledot December 12, 2024 22:10
@Paillat-dev Paillat-dev changed the title ✨ Allow for functools.partials and such as autocomplete feat: ✨ Allow for functools.partials and such as autocomplete Dec 12, 2024
@Paillat-dev
Copy link
Contributor Author

@DefiDebauchery Would you mind testing this pr with your usecase and functools.partial?

@DefiDebauchery
Copy link
Contributor

@DefiDebauchery Would you mind testing this pr with your usecase and functools.partial?

Yes, this did work on my side, thank you! While I also like the solution offered in #2668 (comment), I do think partials make sense in many contexts, and it would be great to have support for those who need something quick.

@plun1331
Copy link
Member

https://discord.com/channels/881207955029110855/881735314987708456/1316992273476747375

@Paillat-dev Paillat-dev changed the title feat: ✨ Allow for functools.partials and such as autocomplete feat: ✨ Allow for functools.partials functions returning an awaitable as autocomplete Dec 13, 2024
@Paillat-dev Paillat-dev changed the title feat: ✨ Allow for functools.partials functions returning an awaitable as autocomplete feat: ✨ Allow for functools.partial functions returning an awaitable as autocomplete Dec 13, 2024
@Paillat-dev Paillat-dev changed the title feat: ✨ Allow for functools.partial functions returning an awaitable as autocomplete feat: ✨ Allow for functools.partial and functions returning an awaitable as autocomplete Dec 13, 2024
@Paillat-dev Paillat-dev marked this pull request as ready for review December 13, 2024 08:08
@Paillat-dev
Copy link
Contributor Author

Oh shoot checks failing... This is why we should be using Annotated for options...

@Paillat-dev Paillat-dev requested a review from DA-344 December 14, 2024 14:58
Signed-off-by: Paillat <me@paillat.dev>
@Paillat-dev Paillat-dev requested a review from DA-344 March 2, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Somehow) Allow autocomplete methods to accept arguments
6 participants