Positional argument erroring when only Self is given

Viewed 24

Working on my View side of the random game which is just a load of commands that players can run. As I have built up all my commands I go to run the program to find any errors, the terminal starts up and I can freely use my HELP commands fine however when I go to use the start command

    def do_start(self):
        self.controller.start_game()

I get the good ol "TypeError: takes 1 positional argument but 2 were given". This command only has access to my Controller which is basically just one giant calling file (pulling all the functions and such together to form the desired outputs)

self.controller.start_game() links to the start_game() function which can be seen below:

    def start_game(self):
        self.game_state = "START"
        self.room_state = "INDOORS"
        self.player.current_location = self.root
        self.game_data.dev_card_pop()
        self.game_data.dev_card_pop()

game_state and room_state are internal's found in the init - this is how i determine where the player (this may change) is and whats happening.

self.player.current_location is there if a player is playing a game and decides to make a new game, it resets it to the root/start location

dev_card_pop() is a function that removes an item for the list, there are two there as I couldn't find a 'clean' and 'simple' way to make this pop 2 items in this case (there are other times where it needs to only pop the 1)

Now the issue becomes "What are the two arguments" because, well if I set this start_game(self) to pass I still get the same error.

I have run through a number of the google results when looking at this error type and same with YouTube however they all seem to be just an echo chamber of each other (with minor changes) all proving to have no results with my issue.

Is it possible that there is an issue because def start_game has self and def do_start also has self so do_start is technically wanting multiple self's? because other than that I am only giving everything a singular argument. I am also not getting any errors within any files that I have so this is all really confusing for me, maybe I am just missing something super obvious?

0 Answers
Related