2
0
Эх сурвалжийг харах

Merge pull request #4090 from bmolyneaux/patch-2

Correct .has() to .has_method()
Rémi Verschelde 4 жил өмнө
parent
commit
84226ec3ab

+ 2 - 2
getting_started/workflow/best_practices/godot_interfaces.rst

@@ -329,7 +329,7 @@ accesses:
       child.set_visible(false)
       child.set_visible(false)
 
 
       # Dynamic lookup, checks for method existence first.
       # Dynamic lookup, checks for method existence first.
-      if child.has("set_visible"):
+      if child.has_method("set_visible"):
           child.set_visible(false)
           child.set_visible(false)
 
 
       # Cast check, followed by dynamic lookup
       # Cast check, followed by dynamic lookup
@@ -344,7 +344,7 @@ accesses:
       # If one does not wish to fail these checks without notifying users, one
       # If one does not wish to fail these checks without notifying users, one
       # can use an assert instead. These will trigger runtime errors
       # can use an assert instead. These will trigger runtime errors
       # immediately if not true.
       # immediately if not true.
-      assert(child.has("set_visible"))
+      assert(child.has_method("set_visible"))
       assert(child.is_in_group("offer"))
       assert(child.is_in_group("offer"))
       assert(child is CanvasItem)
       assert(child is CanvasItem)