Skip to content

Commit 5ffa9a6

Browse files
authored
PEP 681: Fix minor formatting and typographical issues (#2382)
1 parent f52151b commit 5ffa9a6

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

pep-0681.rst

+9-26
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Type checkers supporting this PEP will recognize that the
119119
c5 = CustomerModel(327, "John Smith", 0)
120120
121121
Decorator function example
122-
``````````````````````````
122+
''''''''''''''''''''''''''
123123

124124
.. code-block:: python
125125
@@ -133,7 +133,6 @@ Decorator function example
133133
cls.__eq__ = ...
134134
cls.__ne__ = ...
135135
return cls
136-
137136
138137
# The ``create_model`` decorator can now be used to create new model
139138
# classes, like this:
@@ -143,7 +142,7 @@ Decorator function example
143142
name: str
144143
145144
Class example
146-
`````````````
145+
'''''''''''''
147146

148147
.. code-block:: python
149148
@@ -152,15 +151,14 @@ Class example
152151
@typing.dataclass_transform()
153152
class ModelBase: ...
154153
155-
156154
# The ``ModelBase`` class can now be used to create new model
157155
# subclasses, like this:
158156
class CustomerModel(ModelBase):
159157
id: int
160158
name: str
161159
162160
Metaclass example
163-
`````````````````
161+
'''''''''''''''''
164162

165163
.. code-block:: python
166164
@@ -171,7 +169,6 @@ Metaclass example
171169
172170
class ModelBase(metaclass=ModelMeta): ...
173171
174-
175172
# The ``ModelBase`` class can now be used to create new model
176173
# subclasses, like this:
177174
class CustomerModel(ModelBase):
@@ -189,7 +186,8 @@ these parameters accepts a bool argument, and it must be possible for
189186
the bool value (``True`` or ``False``) to be statically evaluated.
190187

191188
* ``eq``. ``order``, ``frozen``, ``init`` and ``unsafe_hash`` are parameters
192-
supported in the stdlib dataclass, with meanings defined in :pep:`557 <557#id7>`.
189+
supported in the stdlib dataclass, with meanings defined in
190+
:pep:`PEP 557 <557#id7>`.
193191
* ``hash`` is an alias for the ``unsafe_hash`` parameter.
194192
* ``kw_only``, ``match_args`` and ``slots`` are parameters supported
195193
in the stdlib dataclass, first introduced in Python 3.10.
@@ -239,7 +237,7 @@ The following sections provide additional examples showing how these
239237
parameters are used.
240238

241239
Decorator function example
242-
``````````````````````````
240+
''''''''''''''''''''''''''
243241

244242
.. code-block:: python
245243
@@ -254,7 +252,6 @@ Decorator function example
254252
kw_only: bool = True,
255253
) -> Callable[[Type[_T]], Type[_T]]: ...
256254
257-
258255
# Example of how this decorator would be used by code that imports
259256
# from this library:
260257
@create_model(frozen=True, kw_only=False)
@@ -263,7 +260,7 @@ Decorator function example
263260
name: str
264261
265262
Class example
266-
`````````````
263+
'''''''''''''
267264

268265
.. code-block:: python
269266
@@ -281,7 +278,6 @@ Class example
281278
):
282279
...
283280
284-
285281
# Example of how this class would be used by code that imports
286282
# from this library:
287283
class CustomerModel(
@@ -295,7 +291,7 @@ Class example
295291
name: str
296292
297293
Metaclass example
298-
`````````````````
294+
'''''''''''''''''
299295

300296
.. code-block:: python
301297
@@ -319,7 +315,6 @@ Metaclass example
319315
class ModelBase(metaclass=ModelMeta):
320316
...
321317
322-
323318
# Example of how this class would be used by code that imports
324319
# from this library:
325320
class CustomerModel(
@@ -365,7 +360,7 @@ not required:
365360
366361
367362
Field descriptor parameters
368-
```````````````````````````
363+
'''''''''''''''''''''''''''
369364

370365
Libraries that support dataclass-like semantics and support field
371366
descriptor classes typically use common parameter names to construct
@@ -441,7 +436,6 @@ This example demonstrates the above:
441436
init: bool = True,
442437
) -> Callable[[Type[_T]], Type[_T]]: ...
443438
444-
445439
# Code that imports this library:
446440
@create_model(init=False)
447441
class CustomerModel:
@@ -701,14 +695,3 @@ Copyright
701695

702696
This document is placed in the public domain or under the
703697
CC0-1.0-Universal license, whichever is more permissive.
704-
705-
706-
707-
..
708-
Local Variables:
709-
mode: indented-text
710-
indent-tabs-mode: nil
711-
sentence-end-double-space: t
712-
fill-column: 70
713-
coding: utf-8
714-
End:

0 commit comments

Comments
 (0)