Skip to content

Fix minor grammar #25948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Doc/library/dataclasses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ adding generated :term:`special method`\s such as :meth:`__init__` and
in :pep:`557`.

The member variables to use in these generated methods are defined
using :pep:`526` type annotations. For example this code::
using :pep:`526` type annotations. For example, this code::

from dataclasses import dataclass

Expand All @@ -31,7 +31,7 @@ using :pep:`526` type annotations. For example this code::
def total_cost(self) -> float:
return self.unit_price * self.quantity_on_hand

Will add, among other things, a :meth:`__init__` that looks like::
will add, among other things, a :meth:`__init__` that looks like::

def __init__(self, name: str, unit_price: float, quantity_on_hand: int = 0):
self.name = name
Expand All @@ -52,7 +52,7 @@ Module contents
:term:`special method`\s to classes, as described below.

The :func:`dataclass` decorator examines the class to find
``field``\s. A ``field`` is defined as class variable that has a
``field``\s. A ``field`` is defined as a class variable that has a
:term:`type annotation <variable annotation>`. With two
exceptions described below, nothing in :func:`dataclass`
examines the type specified in the variable annotation.
Expand All @@ -62,8 +62,8 @@ Module contents

The :func:`dataclass` decorator will add various "dunder" methods to
the class, described below. If any of the added methods already
exist on the class, the behavior depends on the parameter, as documented
below. The decorator returns the same class that is called on; no new
exist in the class, the behavior depends on the parameter, as documented
below. The decorator returns the same class that it is called on; no new
class is created.

If :func:`dataclass` is used just as a simple decorator with no parameters,
Expand Down Expand Up @@ -202,7 +202,7 @@ Module contents
def __init__(self, a: int, b: int = 0):

:exc:`TypeError` will be raised if a field without a default value
follows a field with a default value. This is true either when this
follows a field with a default value. This is true whether this
occurs in a single class, or as a result of class inheritance.

.. function:: field(*, default=MISSING, default_factory=MISSING, init=True, repr=True, hash=None, compare=True, metadata=None, kw_only=MISSING):
Expand Down Expand Up @@ -395,7 +395,7 @@ Module contents

.. function:: replace(instance, /, **changes)

Creates a new object of the same type of ``instance``, replacing
Creates a new object of the same type as ``instance``, replacing
fields with values from ``changes``. If ``instance`` is not a Data
Class, raises :exc:`TypeError`. If values in ``changes`` do not
specify fields, raises :exc:`TypeError`.
Expand Down