diff --git a/python/python-psi-impl/resources/inspectionDescriptions/PyNewTypeInspection.html b/python/python-psi-impl/resources/inspectionDescriptions/PyNewTypeInspection.html index b3e8f05dff56..8f917efdb93c 100644 --- a/python/python-psi-impl/resources/inspectionDescriptions/PyNewTypeInspection.html +++ b/python/python-psi-impl/resources/inspectionDescriptions/PyNewTypeInspection.html @@ -4,16 +4,23 @@ Reports invalid usages of NewType.
- Example: + Examples:
-from typing import NewType
+ from typing import NewType
-Base = NewType("Base", str)
-A = NewType("B", int) # Variable name 'A' does not match NewType name 'B'
+ InvalidName = NewType("Name", int) # Variable name 'InvalidName' does not match NewType name 'Name'
+
+
+ from typing import Literal
-class Derived(Base): # 'Base' cannot be subclassed
- pass
+ InvalidType = NewType("InvalidType", Literal[1]) # NewType cannot be used with 'Literal[1]'
+
+
+ Base = NewType("Base", str)
+
+ class Derived(Base): # 'Base' cannot be subclassed
+ pass