mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 23:31:05 +07:00
(cherry picked from commit 8996fec06c52cda4d28cd5176ba1d97a7036639b) GitOrigin-RevId: 3bc91b31ef8ecea7cd57b67c7298ed815f9a9116
16 lines
409 B
HTML
16 lines
409 B
HTML
<html>
|
|
<body>
|
|
<p>Reports incorrect use of Python type variables due to variance issues.
|
|
</p>
|
|
|
|
<p><b>Incompatible variance</b></p>
|
|
<pre><code class="language-python">
|
|
from typing import TypeVar, Generic
|
|
T = TypeVar("T", covariant=True)
|
|
class C(Generic[T]):
|
|
def method(self, t: T): # at 'T': A covariant type variable cannot be used in this contravariant position
|
|
pass
|
|
</code></pre>
|
|
|
|
</body>
|
|
</html> |