From 4f3b998b095b11f7460103ef3670e6e0adbb7cb3 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Fri, 2 May 2025 18:20:08 +0300 Subject: [PATCH] Documentation: Add tip to use more specific return type for `_iter_get()` --- doc/classes/Object.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index b8a2212e03..ba6e40a12a 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -198,6 +198,7 @@ Returns the current iterable value. [param iter] stores the iteration state, but unlike [method _iter_init] and [method _iter_next] the state is supposed to be read-only, so there is no [Array] wrapper. + [b]Tip:[/b] In GDScript, you can use a subtype of [Variant] as the return type for [method _iter_get]. The specified type will be used to set the type of the iterator variable in [code]for[/code] loops, enhancing type safety.