Skip to content

Implicit Conversion of Optional Flags #6

@Radagaisus

Description

@Radagaisus

It’s fairly common to use flags both to check whether a given action should be done and use the flag values as data for the action. The implicit type conversion in ArgparsePrompt messes with this pattern. For example:

parser.add_argument('--population_snapshot', type=str, default=None)

Using this definition and using the default value in the prompt will convert None to 'None'.

parser.add_argument('--seed', type=int, default=None)

The same happens here, only this time an exception will be thrown (Argument "seed" was given a value not of type <class 'int'>).

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