Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/classes/Object.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,7 @@
</constant>
<constant name="CONNECT_PERSIST" value="2" enum="ConnectFlags">
Persisting connections are stored when the object is serialized (such as when using [method PackedScene.pack]). In the editor, connections created through the Node dock are always persisting.
[b]Note:[/b] Connections to lambda functions (i.e. when the function code is embedded in the [method connect] call) cannot be made persistent.
Copy link
Member

@Mickeon Mickeon Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so, this ambiguity is why I personally adamantly avoid both "e.g." and "i.e.": Because of what "i.e." literally stands for, this note strongly implies that "lambda" functions are when code is embedded in connect(), and that's really the only exception to CONNECT_PERSIST.

We know both statements aren't true, or at least it's quite misleading, so no point explaining it. However, I must note that we're working with "Callables" here, not just "functions".
In fact, what could be worth testing for this purpose is one fire-sure way to determine whether a Callable is a lambda or not.

No suggestion yet, it's late at night.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And maybe you can add this description on the connections page?

</constant>
<constant name="CONNECT_ONE_SHOT" value="4" enum="ConnectFlags">
One-shot connections disconnect themselves after emission.
Expand Down