Well, this works, thanks. :)
But now I need to create a copy of this list, since I need to call this method later again, after some other methods change self.tab, but I want __str__() to return still the same list. I tried to make a copy of self.tab using "self.tab.copy()" into new variable and this used in __str__(). But whenever I call __str__() after something changed in self.tab, it also changes in self.tab_copy. How to deal with that?
I simply added into __init__ new variable self.tab_copy and in __str__() changed to "return "\n".join([" ".join(map(str, x)) for x in self.tab_copy])", but is still changes the inital self.tab (as I described above).
But now I need to create a copy of this list, since I need to call this method later again, after some other methods change self.tab, but I want __str__() to return still the same list. I tried to make a copy of self.tab using "self.tab.copy()" into new variable and this used in __str__(). But whenever I call __str__() after something changed in self.tab, it also changes in self.tab_copy. How to deal with that?
I simply added into __init__ new variable self.tab_copy and in __str__() changed to "return "\n".join([" ".join(map(str, x)) for x in self.tab_copy])", but is still changes the inital self.tab (as I described above).