Open rpdelaney opened 5 years ago
Might require changes to python-chess
.
https:/docs.python.org/3/library/functions.html#reversed
reversed(seq)
Return a reverse iterator. seq must be an object which has
a __reversed__() method or supports the sequence protocol
(the __len__() method and the __getitem__() method with integer
arguments starting at 0).
Consider extending with a superclass also, in the event that python-chess can't be changed.
niklasf/python-chess/issues/319 enabled use of reversed(node.mainline())
: node.mainline()
now returns an iterator of GameNode
s, not Move
s, and .mainline()
supports the sequence protocol.
This is one of those "what was I thinking?" moments now that I've had some time to level up my python since I wrote this.