niklasf / python-chess

A chess library for Python, with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing, and UCI/XBoard engine communication
https://python-chess.readthedocs.io/en/latest/
GNU General Public License v3.0
2.45k stars 531 forks source link

A few minor cleanups #1013

Closed johndoknjas closed 1 year ago

johndoknjas commented 1 year ago

Just a few small cleanups I made going through the files. I also noticed in test.py, the generate_legal_moves function of MockBoard has a yield right after a return. I tried removing it, but then the checks gave me errors.

niklasf commented 1 year ago

Thanks!

Any yield in a function makes it a generator, so return; yield is a trick to create an empty generator.