Skip to content

remove required=False as a keyword arg #20

@chdsbd

Description

@chdsbd

required=False is the default behavior. We should remove this option to prevent mistakes where callers mistakenly think required=True is the default behavior.

The following definitions are equivalent

class Post:
    author = fields.StringField()

class Post:
    author = fields.StringField(required=False)

This is different.

class Post:
    author = fields.StringField(required=True)

With this change, it would only be possible to write:

class Post:
    author = fields.StringField()

class Post:
    author = fields.StringField(required=True)

The following would error:

class Post:
    author = fields.StringField(required=False)

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