Skip to content
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

Improve default values for automatically-generated text_signature #2863

Closed
davidhewitt opened this issue Jan 6, 2023 · 1 comment
Closed

Comments

@davidhewitt
Copy link
Member

This issue is a follow-up to #2784 to remember to improve the formatting of default values in the generated text_signature.

Currently all default values are just rendered as ..., however Rust integer/boolean/string literals and None should be easy enough to format a Python representation for.

Support for more general Rust literals in the Python signature might need a larger refactoring to do more of the signature generation at runtime using traits.

Both of these will be easier after the signature code is simplified, i.e. once the deprecated #[args] attribute is removed and maybe also #2703 is merged.

bors bot added a commit that referenced this issue Mar 25, 2023
3050: Improve default values for str, numbers and bool in `text_signature` r=davidhewitt a=messense

xref #2863

Co-authored-by: messense <messense@icloud.com>
bors bot added a commit that referenced this issue Apr 12, 2023
3066: Improve default value for `None` in `text_signature` r=davidhewitt a=messense

xref #2863

3098: readme: add new pyo3 article r=adamreichold a=davidhewitt

With thanks to `@ohadravid` for the great piece!

Co-authored-by: messense <messense@icloud.com>
Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
@thomasaarholt
Copy link

I've been reading up on issues related to #2454 (generating python interface / type stubs), and it looks like everything that was in scope for this issue is merged now.

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

No branches or pull requests

3 participants