Skip to content

Marking metadata as optional #27

@shuttle1987

Description

@shuttle1987

Let's say we have a page that could contain socialURL but this may not be present always, how should we go about marking this?

import typing
class ExamplePage1(Templated, Content):
    socialURL: typing.Union[None, dict]
import typing
class ExamplePage2(Templated, Content):
    socialURL: typing.Optional[dict]

Is one of these is preferable to the other?

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