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

replace '<object> == 0' by 'not <object>' & updated f-strings. #1052

Closed ghost closed 1 year ago

ghost commented 1 year ago

Made the following changes:

-> replaced ' == 0' -> 'not object' statements for better runtime. -> replaced a classic string by f-string for better readability & runtime.

niklasf commented 1 year ago

Sorry, in code where the values are really semantically numbers I prefer to compare them as numbers.