I am new to Godot, but have a lot of programing experience so anyone that knows better please feel free to correct me.
But I think the answer is that gdscript is not python.
For example, in python you can call a method from the "module" or "script" itself, but in gdscript it is not possible.
For example one can not do this:

This means that all methods have to be called from an ready or process method etc. And those are called after the whole script is loaded and thus all methods already exists.