pgn-tactics-generator icon indicating copy to clipboard operation
pgn-tactics-generator copied to clipboard

strict argument doesn't seem to work as expected

Open karol-brejna-i opened this issue 3 years ago • 1 comments

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.

karol-brejna-i avatar May 14 '21 14:05 karol-brejna-i

The solution looks good to me

vitogit avatar May 22 '21 19:05 vitogit