Entities is initialized as a list, but code treats it as a set.
Dowsley opened this issue · 2 comments
Dowsley commented
Line 92 in 6e763f1
Python 3.10 will break with other parts of the code such as.
for entity in self.game_map.entities - {self.player}:
TypeError: unsupported operand type(s) for -: 'list' and 'set'
It seems to be a simple fix - just declare it as {player}
. I didn't make a pull request because I don't know in which part this "mistake" began, or if there's something else I'm missing.
HexDecimal commented
GameMap
's initializer always converts that input into a set
, this part is missing from your code:
Lines 14 to 17 in 6e763f1
Your change would be a little more efficient though. Some classes would probably be better written with attrs
.
Dowsley commented
Thank you, I missed that default when following your guide.
I believe it's not worth a change given that.