-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Improve description of Callable.bind/unbind
#76158
Conversation
Technically it does remove arguments bound with func _ready() -> void:
# the 42 bound by `bind(42)` is unbound by `unbind(1)`.
var f := foo.unbind(1).bind(42)
# so you have to provide exactly one argument here.
f.call(100)
func foo(a: int) -> void:
print(a) The key is that foo.unbind(1).bind(42).call(100)
call(100) # argument list is: 100
bind(42) # append 42: 100, 42
unbind(1) # remove 1 from the end: 100
foo.bind(88, 99).unbind(1).call(22, 33)
call(22, 33) # argument list is: 22, 33
unbind(1) # remove 1 from the end: 22
bind(88, 99) # append 88, 99: 22, 88, 99 |
Will add that it doesn't remove arguments previously bound for clarification |
c25d240
to
a7eab72
Compare
Clarified that description and added an example to illustrate it. (My bad forgot |
c0810d9
to
67ccaff
Compare
67ccaff
to
88caec6
Compare
88caec6
to
5a8b337
Compare
Callable.unbind
Callable.bind/unbind
5a8b337
to
7e6d9c8
Compare
7e6d9c8
to
0332fd5
Compare
Thank you for your help |
Thanks! |
Thank you! |
Cherry-picked for 4.0.3. |
Fixes #76141