godotengine / godotengine/godot-docs

Misleading description for Callable ==

Open
#11,295 2 comments 1 reaction 0 assignees View on GitHub
area:class reference bug
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

I'm not actually sure how to improve the description because the behaviour of bound callables is so confusing; thus I'm opening an issue instead of a PR so that more qualified people can share their input.

**Godot version: 4.5 and below**

**Issue description:**

The documentation of the == operator for Callable mentions that `true` is returned if the compared callable invokes the same target - that is, however, not exactly true. The current behavior is the following:
```
print.bind("apple") == print; // false, as expected
print.bind("apple") == print.bind("apple"); // true, for the wrong reasons
print.bind("apple") == print.bind("tomato"); // true as well
print.bind("apple") == print.bind("tomato", "apple"); false
```

When comparing callables, the *amount* of bound arguments is compared, not what they actually are. The documentation *should* inform of this behavior, but I'm not exactly sure how to explain this in a concise manner.

**URL to the documentation page:**

https://docs.godotengine.org/en/stable/classes/class_callable.html#class-callable-operator-eq-callable

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.