Prohibit type variables inside ClassVar (#254)
Prohibit type variables inside TypeVar
This commit is contained in:
parent
4205604fc8
commit
1ef52e9d6a
|
@ -229,6 +229,10 @@ Here ``ClassVar`` is a special class defined by the typing module that
|
|||
indicates to the static type checker that this variable should not be
|
||||
set on instances.
|
||||
|
||||
Note that a ``ClassVar`` parameter cannot include any type variables, regardless
|
||||
of the level of nesting: ``ClassVar[T]`` and ``ClassVar[List[Set[T]]]`` are
|
||||
both invalid if ``T`` is a type variable.
|
||||
|
||||
This could be illustrated with a more detailed example. In this class::
|
||||
|
||||
class Starship:
|
||||
|
|
Loading…
Reference in New Issue