Skip to content

Commit 559ed14

Browse files
committed
Small documentation tweaks
1 parent a946ee1 commit 559ed14

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/source/class_basics.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ initialized within the class. Mypy infers the types of attributes:
2020
a.y = 3 # Error: A has no attribute y
2121
2222
This is a bit like each class having an implicitly defined
23-
``__slots__`` attribute. In Python semantics this is only enforced
24-
during type checking: at runtime we use standard Python semantics.
23+
``__slots__`` attribute. This is only enforced during type
24+
checking and not when your program is running.
2525

2626
You can declare types of variables in the class body explicitly using
2727
a type comment:
@@ -93,11 +93,11 @@ override has a compatible signature:
9393
You can also override a statically typed method with a dynamically
9494
typed one. This allows dynamically typed code to override methods
9595
defined in library classes without worrying about their type
96-
signatures, similar to Python.
96+
signatures.
9797

9898
There is no runtime enforcement that the method override returns a
99-
value that is compatible with the original return type, since types
100-
are erased in the Python semantics:
99+
value that is compatible with the original return type, since
100+
annotations have no effect at runtime:
101101

102102
.. code-block:: python
103103

0 commit comments

Comments
 (0)