Skip to content

Set var: Optional[Type] to None via CLI #348

Open
@anqixu

Description

@anqixu

Let me start by saying that SimpleParsing is an amazingly useful library!

This question has been asked previously, but I haven't seen a direct line of discussion.

Consider the following use case:

@dataclass
class ProcessFlow:
  do_step: Optional[FlowParams] = FlowParams()
$ ./run.py --do_step=None  # or =null

The above syntax has the downside that, given var: Optional[str], it would cause a contention between passing in the string keyword is used to represent None, versus the string literal "None". In this edge case, we can consider preferring e.g. None over "None".

What do you guys think? @lebrice?

Many thanks!

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