Clarify var_to_bytes() encoding empty Callables#120654
Conversation
Calinou
commented
Jun 26, 2026
- This closes False or misleading var_to_bytes() note about encoding Callable godot-docs#12077.
|
Isn't the same true for
This PR should probably mention that as well, or just outright copy the note from |
Mickeon
left a comment
There was a problem hiding this comment.
Please someone verify what was stated by @GabCoolDude and if true, just copy the note from var_to_str's description.
I myself can't imagine why it would be different between the bytes and string conversion functions.
|
It is true, in a sense, it encodes an empty entry which is a padded array, and on decoding it simply constructs an empty callable: Lines 789 to 791 in d3a5a85 The entry is still written though and stores the type |
|
Looking at the code for encoding Lines 1820 to 1831 in d3a5a85 This is actually different from how godot/core/variant/variant_parser.cpp Lines 2167 to 2173 in d3a5a85 The difference doesn't make much sense, seeing as the So I guess the correct thing to do would be to add another note saying that decoding a |