JuliaPy / PythonCall.jl

Python and Julia in harmony.
https://juliapy.github.io/PythonCall.jl/stable/
MIT License
720 stars 61 forks source link

Why does the argument order of `pyconvert_add_rule` deviate from convention #363

Open LilithHafner opened 9 months ago

LilithHafner commented 9 months ago

According to the Julia Docs, function arguments should be placed first because "Putting a function argument first permits the use of do blocks for passing multiline anonymous functions."

Is there a reason for not following this convention? Would it be reasonable to support the conventional argument order in addition to the current argument order? Can we switch fully to the conventional argument order and deprecate the current argument order / remove it in the next breaking release?

cjdoris commented 9 months ago

No particular reason. It started life as a non-API function. I'll consider this for v1 - the pyconvert machinery is going to be overhauled anyway.

cjdoris commented 9 months ago

Feel free to make a PR to add a version with the function-first order.