Open williamd1k0 opened 7 years ago
Yes, optional arguments are not handled right now
However this can be implemented fairly easy: a bind function is generated for each method of a Godot node.
Right now the bind
method only take a *args
parameter and use a dictionary given by meth['args']
to make sure the types and right. You can add a **kwargs
and test it against meth['args']
items in the same way.
If you need help, you go in the Godot's Discord channel, I hang there pretty often ;-)
I took a look at the bind stuff but I don't know how to check/get the default values for optional methods.
There is a default_args
key in the meth dict but it always appears as empty (probably not implemented yet).
I don't know if I'm doing something wrong but all Godot methods that contain optional arguments are being called as if all arguments were positional.
Eg:
Node.add_child( Node node, bool legible_unique_name=false )
The
node
argument is positional butlegible_unique_name
is optional.So, calling this by passing only
node
argument triggers a TypeError.Python traceback:
Also, I'm using your release v0.9.0 for Linux.