Skip to content

Two (possible) improvements at dataclasses.rst #91687

@xandrade

Description

@xandrade

Documentation

Observed two possible improvements at dataclasses.rst

  1. One of the examples at line 705 is throwing an exception. I would kindly suggest to update x: List = [] by x: list = field(default_factory=list) to avoid the following exception: ValueError: mutable default <class 'list'> for field x is not allowed: use default_factory
  2. Remove trailing whitespace in line 745 to avoid exception with automated Azure PR Validation.

@ericvsmith I would be more than happy to raise a PR for above.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc direasy
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions