From 757c2b479c49dff45c9e47fbc24d1510cf4034db Mon Sep 17 00:00:00 2001 From: xks <2777389616@qq.com> Date: Sun, 1 Nov 2026 18:27:05 +0800 Subject: [PATCH] delete mypy specific behavior description --- docs/spec/annotations.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/spec/annotations.rst b/docs/spec/annotations.rst index 813766bd1..8fbf13366 100644 --- a/docs/spec/annotations.rst +++ b/docs/spec/annotations.rst @@ -37,15 +37,6 @@ instance and class methods (conventionally named ``self`` or ``cls``), which type checkers should assume to have an appropriate type, as per :ref:`annotating-methods`. -(Note that the return type of ``__init__`` ought to be annotated with -``-> None``. The reason for this is subtle. If ``__init__`` assumed -a return annotation of ``-> None``, would that mean that an -argument-less, un-annotated ``__init__`` method should still be -type-checked? Rather than leaving this ambiguous or introducing an -exception to the exception, we simply say that ``__init__`` ought to -have a return annotation; the default behavior is thus the same as for -other methods.) - A type checker is expected to check the body of a checked function for consistency with the given annotations. The annotations may also be used to check correctness of calls appearing in other checked functions.