Parameter self unfilled, but when I fill it it gives expected type ' ' but got 'Type[]' warning

The attribute godHole of class Player, it is just a class, and no instantiation operation is performed, you directly use the instance method return_stones below, and pass in the class GodHole, which is wrong.

There are two ways to execute instance methods:

  1. call directly using the class instance
  2. when a class uses an instance method, the instance is passed in as a parameter
class Player:

   def __init__(self):
       self.godHole = GodHole()
       self.pits = []
       for i in range(0, 6):
           self.pits.append(Pit())

   def return_stones(self):
       return self.godHole.return_stones()

or

class Player:

   def __init__(self):
       self.godHole = GodHole
       self.pits = []
       for i in range(0, 6):
           self.pits.append(Pit())

   # def return_stones(self):
       # return self.godHole.return_stones(self.godHole())

   def return_stones(self, obj: GodHole):
       # obj is an instance object of class GodHole
       return self.godHole.return_stones(obj)