File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -428,10 +428,10 @@ def _infer_constraints(
428428
429429
430430def _is_type_type (tp : ProperType ) -> TypeGuard [TypeType | UnionType ]:
431- """Is ``tp`` a type[...] or union thereof?
431+ """Is ``tp`` a `` type[...]`` or a union thereof?
432432
433- Type[A | B] is internally represented as type[A] | type[B], and this troubles
434- the solver sometimes.
433+ `` Type[A | B]`` is internally represented as `` type[A] | type[B]`` , and this
434+ troubles the solver sometimes.
435435 """
436436 return (
437437 isinstance (tp , TypeType )
@@ -441,11 +441,7 @@ def _is_type_type(tp: ProperType) -> TypeGuard[TypeType | UnionType]:
441441
442442
443443def _unwrap_type_type (tp : TypeType | UnionType ) -> ProperType :
444- """Rewrite `type[A] | type[B]` as `type[A | B]`.
445-
446- This is an opposite of normalized form used elsewhere, necessary to solve type[...]
447- constraints on typevars.
448- """
444+ """Extract the inner type from ``type[...]`` expression or a union thereof."""
449445 if isinstance (tp , TypeType ):
450446 return tp .item
451447 return UnionType .make_union ([cast (TypeType , get_proper_type (o )).item for o in tp .items ])
You can’t perform that action at this time.
0 commit comments