Visitar URL original
Missing import in example at dataclasses.rst · Issue #91673 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20260522170739/https://github.com/python/cpython/issues/91673
Skip to content
/ cpython Public

Missing import in example at dataclasses.rst  #91673

@xandrade

Description

@xandrade

Documentation

Found that the typing List is used in example, but import is missed at dataclasses.rst file.

In this example:

  @dataclass
  class D:
      x: List = []
      def add(self, element):
          self.x += element

the import from typing import List is missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir
    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