Closed Debilski closed 4 months ago
The need for a compatibility decorator has been discussed and implemented in the private repo where we store notable bots
I forgot to link the file in the (private) repo: https://github.com/ASPP/pelita_private_bots/blob/main/sparring_bots/compatibility_decorators.py
(Not sure whether this is a bug or more of a sticky issue to keep in mind.)
Thinking about the suggestion in #789 I found a problem in modifying
bot.legal_positions
that subtly breaks when used in code switching scenarios.Assuming
team_a.move
consumesbot.legal_positions
, this will alter the behaviour of theteam_b.move
function. This is kind of what you’d expect Python to do, so in itself it is not surprising (and it could be what you want to do), but it does break our ‘promise’ of ‘move function reuse’ that we advertise in the tutorial. Meaning that we really should be careful when using eitheror even
in our demo code. (Any of our example code will make it verbatim to at least one user’s bot.)
I don’t really know what to do about this (making
bot.legal_positions
an explicit function would be the most obvious fix) but this also means that #789 could have broken some earlier bots so we should keep this issue in mind.