microsoft / llguidance

Low-level Guidance Parser
MIT License
30 stars 7 forks source link

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

Closed hudson-ai closed 5 days ago

hudson-ai commented 5 days ago

The signature of JsonCompiler in the .pyi was wrong.

@lochuynh1412 fyi

hudson-ai commented 5 days ago

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.

mmoskal commented 5 days ago

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...