Skip to content

Commit f94601c

Browse files
methanehugovk
andauthored
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 4fd34d2 commit f94601c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

peps/pep-0781.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Abstract
1313
========
1414

1515
This PEP proposes adding a new keyword ``__type_checking__`` that serves the
16-
same purpose as ``typing.TYPE_CHECKING``.
16+
same purpose as :data:`typing.TYPE_CHECKING`.
1717
This constant is ``True`` when the code is being analyzed by a static type
1818
checker, and ``False`` during normal runtime execution.
1919

@@ -43,8 +43,8 @@ Specification
4343
It can be used in the same way as ``False``, except it can not be used as
4444
a matching pattern.
4545

46-
Similar to typing.TYPE_CHECKING, type checking tools should treat
47-
``__type_checking__`` as True.
46+
Similar to :data:`typing.TYPE_CHECKING`, type checking tools should treat
47+
``__type_checking__`` as ``True``.
4848

4949

5050
Rationale
@@ -69,15 +69,14 @@ How to teach this
6969
Add this note to the ``typing.TYPE_CHECKING`` document:
7070

7171
> If you don't want to import ``typing``, you can use ``__type_checking__``.
72-
> Workaround like ``TYPE_CHECKING = False`` or
72+
> Workarounds like ``TYPE_CHECKING = False`` or
7373
> ``if False: # TYPE_CHECKING`` are not recommended since Python 3.14.
7474

7575

76-
Resources
77-
=========
76+
Reference Implementation
77+
========================
7878

79-
* Previous discussion: https://discuss.python.org/t/76766
80-
* Reference Implementation: https://github.com/python/cpython/pull/131641
79+
* `python/cpython#131641 <https://github.com/python/cpython/pull/131641>`__
8180

8281

8382
Copyright

0 commit comments

Comments
 (0)