F
F
frankwolf2018-07-06 10:07:03
Python
frankwolf, 2018-07-06 10:07:03

How to solve TypeError: fill_pos() missing 1 required positional argument: 'checkerobject'?

field.py file

class Field: 
    #Здесь код
    def fill_pos(self, position, checker, team, checkerobject):
        self.checkerboard[int(position[1]) - 1]['field'][position[0]][1] = self.fill
        self.checkerboard[int(position[1]) - 1]['field'][position[0]][2] = checker
        self.checkerboard[int(position[1]) - 1]['field'][position[0]][3] = team
        self.checkerboard[int(position[1]) - 1]['field'][position[0]][4] = checkerobject

Another file
import field, checkers
field = field.Field
checker1 = checkers.Checker('0', 1, ['A', 1], field)
field.fill_pos(['A', 1], False, 1, checker1)

Error: field.fill_pos(['A', 1], False, 1, checker1)
TypeError: fill_pos() missing 1 required positional argument: 'checkerobject'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-07-06
@immaculate

field = field.Field()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question