@@ -466,7 +466,7 @@ assert not list_in_mixed(object)
466466assert list_in_mixed(type)
467467
468468[case testListBuiltFromGenerator]
469- def test () -> None:
469+ def test_from_gen () -> None:
470470 source_a = ["a", "b", "c"]
471471 a = list(x + "f2" for x in source_a)
472472 assert a == ["af2", "bf2", "cf2"]
@@ -486,12 +486,6 @@ def test() -> None:
486486 f = list("str:" + x for x in source_str)
487487 assert f == ["str:a", "str:b", "str:c", "str:d"]
488488
489- [case testNextBug]
490- from typing import List, Optional
491-
492- def test(x: List[int]) -> None:
493- res = next((i for i in x), None)
494-
495489[case testListGetItemWithBorrow]
496490from typing import List
497491
@@ -540,7 +534,7 @@ def test_sorted() -> None:
540534
541535[case testIsInstance]
542536from copysubclass import subc
543- def test () -> None:
537+ def test_built_in () -> None:
544538 assert isinstance([], list)
545539 assert isinstance([1,2,3], list)
546540 assert isinstance(['a','b'], list)
@@ -555,15 +549,17 @@ def test() -> None:
555549 assert not isinstance(1, list)
556550 assert not isinstance('a', list)
557551
552+ def test_user_defined() -> None:
553+ from userdefinedlist import list
554+
555+ assert isinstance(list(), list)
556+ assert not isinstance([list()], list)
557+
558558[file copysubclass.py]
559559from typing import Any
560560class subc(list[Any]):
561561 pass
562562
563- [case testUserDefinedList ]
563+ [file userdefinedlist.py ]
564564class list:
565565 pass
566-
567- def test() -> None:
568- assert isinstance(list(), list)
569- assert not isinstance([list()], list)
0 commit comments