I wrote a function with the following signature:
function setOptimStatus(patientID::Int, status::String; rcProject::PyObject=0, repeatInst::Int=0).
When called with two parameters, I get the following error message:
ERROR: MethodError: no method matching #setOptimStatus#37(::Int64, ::Int64, ::#setOptimStatus, ::Int64, ::String) Closest candidates are: #setOptimStatus#37(::PyCall.PyObject, ::Int64, ::Any, ::Int64, ::String) at /path/source.jl:xxx
I find the function signature in the error message misleading, since it states 5 parameters, while the function only has 4. Moreover, the parameters are in strange order: (3, 4, X, 1, 2), where X is the additional/dummy parameter.
Is this meant to be so, or is it a bug? (And if the latter, should I report it?)
By the way, to remove the error, all I needed to do was to change the third parameter to
rcProject::PyObject=PyObject(0), because otherwise it converts the value to
Int … which I also find strange: since the parameter is specified to be of type
PyObject – is this a bug?
Instead, I would expect one of the following to happen:
- 0 gets converted to
PyObject(0)automatically and everything works
- I get an error that 0 cannot be converted to
PyObject(0)… ideally during compilation, instead of runtime, but that is probably just my