Make it possible to use inheritance on generics without always specifying type vars, see also discussion in #1593

This commit is contained in:
Dave Halter
2020-06-06 01:23:14 +02:00
parent cf923ec6de
commit df7dd026d2
5 changed files with 38 additions and 4 deletions

View File

@@ -126,3 +126,19 @@ for p in typed_bound_generic_passthrough(untyped_list_str):
for q in typed_bound_generic_passthrough(typed_list_str):
#? str()
q
class CustomList(List):
def get_first(self):
return self[0]
#? str()
CustomList[str]()[0]
#? str()
CustomList[str]().get_first()
#? str()
typed_fully_generic_passthrough(CustomList[str]())[0]
#?
typed_list_generic_passthrough(CustomList[str])[0]