While commenting on #243 re converting between a putative coord type to pad, it dawned on me that the current implementation of referring to pads by coordinates is buggy.
which will throw an (uncaught) KeyError if you refer to something off the board.
At the very least find_pad() should catch KeyError and transform it to an EvaluationError.
Note that there's a distinction that will be made between the situation in which the coordinate refers off the board (which will throw an exception) and the situation in which it refers to a dead pad, which will return a pad whose (Python) exists attribute is False. This implies that it should be possible to ask
if p is dead { ... }
Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 16, 2023 at 10:51 AM PST.
While commenting on #243 re converting between a putative
coord
type topad
, it dawned on me that the current implementation of referring to pads by coordinates is buggy.The result of
(x,y)
is defined bywhere
Board.pad_at()
is simplywhich will throw an (uncaught)
KeyError
if you refer to something off the board.At the very least
find_pad()
should catchKeyError
and transform it to anEvaluationError
.Note that there's a distinction that will be made between the situation in which the coordinate refers off the board (which will throw an exception) and the situation in which it refers to a dead pad, which will return a pad whose (Python)
exists
attribute isFalse
. This implies that it should be possible to askMigrated from internal repository. Originally created by @EvanKirshenbaum on Feb 16, 2023 at 10:51 AM PST.