What is the GDScript equivalent of interfaces in other programming languages such as Java, C#, Object Pascal, etc.q

Basically I want to build an extensible system with stuff that makes sense and it’s easy to maintain and expand over time. In other OOP languages I’d use interfaces for that, but what do I do in GDScript?

Using a base class with the required base vars and funcs common to all extendable subclasses, then extend base class case by case? It’s been working fine here

GDScript is purely interpreted. It doesn’t really use the concept of an “interface.” If I have Cat extends Animal and also Rock extends RigidBody but both of them should have a weight, there’s no way to explicitly require and ensure that both classes have that variable provided. However, if the variable is defined:

var weight: int = 10

Then, that instance can be used, without having to type the variable at all.

func lift(thing): // can be any Object
  // Only creates errors runtime, if weight doesn't exist.
  if thing.weight > 10: 
      print("wow thing is heavy")
  return true

Interpreted languages are a bit different from what you’re used to with statically-compiled ones. The compiler here doesn’t really exist.

Read here for the full story:

This is better reading: Allow explicitly defining interfaces in GDScript · Issue #4872 · godotengine/godot-proposals · GitHub

And multiple inheritance is a very important OOP pattern, interfaces being the easiest way to accomplish it.