Skip to content

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

@karol-brejna-i

Description

@karol-brejna-i

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

parser.add_argument("--includeBlunder", metavar="INCLUDE_BLUNDER", default=True,
type=str2bool, const=True, dest="include_blunder", nargs="?",
help="If False then generated puzzles won't include initial blunder move")
would fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions