Skip to content

How to provide default value to StrictBool? #690

@pykong

Description

@pykong

How can we provide a default value to a variable with type StrictBool in a way that is accepted by MyPy?

from pydantic import BaseModel

class Flags(BaseModel):
    pretend: StrictBool = False  # MyPy does not like this

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions