Skip to content

Commit c048835

Browse files
author
Leo Ji
committed
address review: start new paragraph for invariance error example
Made-with: Cursor
1 parent 5863242 commit c048835

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docs/source/common_issues.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,10 @@ Most mutable generic collections are invariant. When using the legacy
307307
``TypeVar`` syntax, mypy considers all user-defined generic classes invariant
308308
by default (see :ref:`variance-of-generics` for motivation). When using the
309309
:pep:`695` syntax (``class MyClass[T]: ...``), variance is inferred from
310-
usage rather than defaulting to invariant. This could lead to some unexpected
311-
errors when combined with type inference. For example:
310+
usage rather than defaulting to invariant.
311+
312+
The fact that mutable sequences are usually invariant can lead to some
313+
unexpected errors when combined with type inference. For example:
312314

313315
.. code-block:: python
314316

0 commit comments

Comments
 (0)