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

Object's get_method_list() should expound on returned Dictionaries' contents. #4894

Closed
cgbeutler opened this issue May 6, 2021 · 0 comments · Fixed by godotengine/godot#67880
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@cgbeutler
Copy link

Your Godot version:
v3.3

Issue description:
Object's get_method_list() currently reads:

Returns the object's methods and their signatures as an Array.

It returns an array of dictionaries with lots of information about each method. It would be nice to document what is in that dictionary (much like get_property_list has.)
Here is an example of a function's dictionary:

>$  { args:[], default_args:[...], flags:33, id:0, name:_setup_local_to_scene, return:{class_name:, hint:0, hint_string:, name:, type:0, usage:7}}

So, the documentation could read something like:

Returns the object's methods and their signatures as an Array of Dictionaries.

Each method's Dictionary contains id: int, name: String, flags: int (see MethodFlags), args: Array, default_args: Array, and return: Dictionary.

(with MethodFlags linking to @GlobalScope's MethodFlags)

We could also add something for the args and default args format, but they seem a bit off, atm. I may submit a bug for them. (their names and show up as arg0, arg1, etc. instead of their script name. Default args seem to shows up empty most of the time.) If we wanted to add them, someone with know-its would have to fill that part in. It looks like it follows the format of get_property_list properties, but that doesn't make sense to me... I mean, what would PROPERTY_USAGE mean on a return variable!?

URL to the documentation page (if already existing):
https://docs.godotengine.org/en/stable/classes/class_object.html#class-object-method-get-method-list

@Calinou Calinou added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants