lebrice / SimpleParsing

Simple, Elegant, Typed Argument Parsing with argparse
MIT License
399 stars 49 forks source link

Add support for simple Literal fields #152

Closed lebrice closed 2 years ago

lebrice commented 2 years ago

This adds support for simple fields, like:

from typing import Literal
from dataclasses import dataclass

@dataclass
class Config:
    model: Literal["resnet18", "resnet50"] = "resnet18"

Also adds support for:

Doesn't yet add support for:

Signed-off-by: Fabrice Normandin fabrice.normandin@gmail.com