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

fix the pyi to reflect the correct signature of JsonCompiler #60

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

hudson-ai
Copy link
Collaborator

The signature of JsonCompiler in the .pyi was wrong.

@lochuynh1412 fyi

@hudson-ai hudson-ai requested a review from mmoskal November 21, 2024 22:14
Copy link
Collaborator

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, in py.rs

    #[pyo3(signature = (separators = None, whitespace_flexible = false))]
    fn py_new(separators: Option<(String, String)>, whitespace_flexible: bool) -> Self {

i think the following would have the same effect:

    fn py_new(separators: Option<(String, String)>, whitespace_flexible: Option<bool>) -> Self {

@hudson-ai
Copy link
Collaborator Author

I think the following would have the same effect:

    fn py_new(separators: Option<(String, String)>, whitespace_flexible: Option<bool>) -> Self {

Interesting. Are you sure that's the same? From the python-side, I don't want to accept None as a value for whitespace_flexible, it's a boolean with a default value. Need to read a bit of py03 documentation to see how this stuff actually works.

@hudson-ai hudson-ai merged commit 8a4d88a into guidance-ai:main Nov 21, 2024
1 check passed
@mmoskal
Copy link
Collaborator

mmoskal commented Nov 21, 2024

you're probably right; I sort of assumed passing None and not passing arg should behave the same from the user PoV, but maybe that's not how you do things in Python-land.

One could clearly see the advantage of having both null and undefined in JS! Well... not really...

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

Successfully merging this pull request may close these issues.

2 participants