Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for simple Literal fields #152

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Add support for simple Literal fields #152

merged 1 commit into from
Aug 3, 2022

Commits on Aug 3, 2022

  1. Add support for simple Literal fields

    This adds support for simple fields, like:
    
    ```python
    from typing import Literal
    from dataclasses import dataclass
    
    @DataClass
    class Config:
        model: Literal["resnet18", "resnet50"] = "resnet18
    ```
    
    Also adds support for:
    - Literal[ints]
    - Literal[enums]
    
    Doesn't yet add support for:
    - Optional[Literal[X]]
    - List[Literal[X]]
    - Tuple[Literal[X], ...]
    
    Signed-off-by: Fabrice Normandin <fabrice.normandin@gmail.com>
    lebrice committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    81e3a6d View commit details
    Browse the repository at this point in the history