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

Python constructor argument order is alphabetical #55

Open
vipshek opened this issue Nov 27, 2018 · 3 comments
Open

Python constructor argument order is alphabetical #55

vipshek opened this issue Nov 27, 2018 · 3 comments

Comments

@vipshek
Copy link

vipshek commented Nov 27, 2018

The generated constructor for a Conjure-defined object currently has its arguments ordered by optional vs. non-optional, followed by alphabetical order. This is defined here.

This seems to be out of sync with generated Java clients for Conjure objects, which have an .of() method whose argument order matches the order in the original Conjure YML definition. Is there a strong reason for this difference between the Java and Python clients?

@ferozco
Copy link
Contributor

ferozco commented Nov 28, 2018

I would not compare the .of() factory method of some conjure-java beans with the constructor of the conjure-python "object" classes.

In Java, the .of() method is simply a convenience wrapper around the builder for beans with small number of arguments. In Python, the constructor is the equivalent of the Java builder and is the only way to create these objects.

I do agree though that the current ordering is not ideal. Long term we want to major rev the code gen and make all constructor and endpoint arguments kwargs for robustness (prevent binary breaks caused by backwards compatible API changes) and clarity

@AaronJRubin
Copy link

@ferozco : Is this long-term change (making all constructor and endpoint arguments kwargs for robustness) still on your roadmap? I think that there is an argument to be made that this major rev can also come with dropping Python2 support (Python2 was sunset more than a year ago), which would make the implementation of enforcing mandatory keyword args a great deal simpler.

@ferozco
Copy link
Contributor

ferozco commented Feb 4, 2021

Hey @AaronJRubin I've rolled off of the team and I don't believe there is any active development on Conjure-python right now. @carterkozak or @jkozlowski are the best people to ask

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

No branches or pull requests

3 participants