GDScript is a dynamically typed scripting language
with a Python-like syntax. For example, the if
,
while
, and for
statements have exactly the same syntax in Python and GDScript.
The table below shows some differences between Python and GDScript that programmers will frequently encounter. You can find full GDScript documention on the Godot web site.
|
Python |
GDScript |
---|---|---|
boolean constants |
|
|
integers |
any size |
64-bit signed |
integer division |
|
|
chained comparisons |
yes |
no |
type check operator |
|
|
|
|
|
dynamic array type |
|
|
list/array length |
|
|
|
yes |
no |
tuples |
yes |
no |
assignment to pattern |
yes |
no |
|
|
|
constant definition |
(implicit) |
|
variable definition |
(implicit) |
|
function declaration |
|
|
lambda syntax |
|
|
self |
explicit |
implicit |
set type |
yes |
no |
|
|
|
queue, priority queue types |
yes |
no |