Closed Tillsten closed 5 years ago
Hmmm, or is this already handled by len=in
?
For cam_read_loop
, it sounds like you want len=in
. This would give you a method that you'd call like cam.read_loop(num_reads)
.
In your first case, it might help if you gave an example of the function being wrapped. arr
and arr[n]
tell nicelib to automatically create an empty array and pass it in. If the length is not specified, nicelib cannot know how big to make this array.
If instead the user is supposed to explicitly pass in the array, you can use in
or inout
.
You are right, my problems are solved by using in and supply the array directly. It may be helpful to make this option clearer in the docs. Btw is there a reason that keyword arguments are not supported by the mid-level bindings?
Feel free add a feature request for keyword argument support. This isn't currently supported because we only recently started extracting function argnames from headers and adding them to the docstrings. Now that we do that, it probably wouldn't take much effort to implement.
We also could consider allowing users to specify new, "nicer" argnames within Sig definitions.
Going over the docs now, it appears we don't have an option to pass in an array and auto-specify its length. We could add arrin
and bufin
options for this case. I'll open an issue for this particular feature request.
FYI I just added kwarg support for python > 3.3 in 279fe2263e41c068e87e4f7dfa8a12b4aa380c20. Check it out and let me know if you have any issues.
Maybe i am missing something: I try to wrap a library where I sometimes have to pass an array without its size. Since the size changes, I can't use
arr[n]
. Is there are workaround? Similar issue is where I have something likeThe size of the array then should be a multiple of number_of_reads.