vitogit / pgn-tactics-generator

Generate chess puzzles / tactics from a pgn file
MIT License
114 stars 28 forks source link

strict argument doesn't seem to work as expected #21

Open karol-brejna-i opened 3 years ago

karol-brejna-i commented 3 years ago

Consider the following pseudocode (in main):

settings = parser.parse_args()
print(f'strict value: {settings.strict}')
print(f'strict type: {type(settings.strict)}')
print(f'strict boolean: {bool(settings.strict)}')

The following invocation:

(.venv) pgn-tactics-generator$ ./main.py --strict=False

would produce unwanted results:

strict value: False
strict type: <class 'str'>
strict boolean: True
Looking up stockfish-x86_64-bmi2 ...

strict variable value is 'False' (string). bool( evaluates to True...

Probably something similar to https://github.com/vitogit/pgn-tactics-generator/blob/f81c42182cd042a6f51136e5c98f719db283955b/main.py#L46-L48 would fix the issue.

vitogit commented 3 years ago

The solution looks good to me