@@ -38,7 +38,7 @@ def __init__(self, first_name: str, last_name: str):
3838
3939def validate_oop_person (solution_result ):
4040 assert not isinstance (
41- solution_result , ( str , int , float , bool , list , dict , tuple , set )
41+ solution_result , str | int | float | bool | list | dict | tuple | set
4242 ), "Solution must return a class instance, not a datatype."
4343 assert type (solution_result ).__module__ != "builtins" , (
4444 "Solution must return an instance of a custom class, not a built-in type."
@@ -214,7 +214,7 @@ def __eq__(self, other):
214214
215215def validate_oop_compare_persons (solution_result ):
216216 assert not isinstance (
217- solution_result , ( str , int , float , bool , list , dict , tuple , set )
217+ solution_result , str | int | float | bool | list | dict | tuple | set
218218 ), "Solution must return a class instance, not a datatype."
219219 assert type (solution_result ).__module__ != "builtins" , (
220220 "Solution must return an instance of a custom class, not a built-in type."
@@ -280,7 +280,7 @@ def __str__(self):
280280
281281def validate_ice_cream_scoop (solution_result ):
282282 assert not isinstance (
283- solution_result , ( str , int , float , bool , list , dict , tuple , set )
283+ solution_result , str | int | float | bool | list | dict | tuple | set
284284 ), "The returned list must contain class instances, not datatypes."
285285 assert type (solution_result ).__module__ != "builtins" , (
286286 "The returned list must contain instances of a custom class, not a built-in type."
@@ -369,7 +369,7 @@ def __str__(self):
369369
370370def validate_ice_cream_bowl (solution_result ):
371371 assert not isinstance (
372- solution_result , ( str , int , float , bool , list , dict , tuple , set )
372+ solution_result , str | int | float | bool | list | dict | tuple | set
373373 ), "Solution must return a class instance, not a datatype."
374374 assert type (solution_result ).__module__ != "builtins" , (
375375 "Solution must return an instance of a custom class, not a built-in type."
@@ -396,13 +396,13 @@ def validate_ice_cream_bowl(solution_result):
396396 raise SubAssertionError from None
397397 assert len (attrs ) == 1 , "The class should have 1 attribute."
398398 assert "scoops" in attrs , "The class attribute should be 'scoops'."
399- assert isinstance (solution_result .scoops , ( list , set , tuple ) ), (
399+ assert isinstance (solution_result .scoops , list | set | tuple ), (
400400 "The class attribute 'scoops' should be a datatype that acts as a container."
401401 )
402402 for scoop in solution_result .scoops :
403- assert not isinstance (scoop , ( str , int , float , bool , list , dict , tuple , set )), (
404- "The 'scoops' container must contain class instances, not datatypes."
405- )
403+ assert not isinstance (
404+ scoop , str | int | float | bool | list | dict | tuple | set
405+ ), "The 'scoops' container must contain class instances, not datatypes."
406406 assert type (scoop ).__module__ != "builtins" , (
407407 "The 'scoops' container must contain instances of a custom class, not a built-in type."
408408 )
@@ -467,7 +467,7 @@ def __le__(self, other):
467467
468468def validate_ice_cream_shop (solution_result ):
469469 assert not isinstance (
470- solution_result , ( str , int , float , bool , list , dict , tuple , set )
470+ solution_result , str | int | float | bool | list | dict | tuple | set
471471 ), "Solution must return a class instance, not a datatype."
472472 assert type (solution_result ).__module__ != "builtins" , (
473473 "Solution must return an instance of a custom class, not a built-in type."
@@ -490,7 +490,7 @@ def validate_ice_cream_shop(solution_result):
490490 raise SubAssertionError from None
491491 assert len (attrs ) == 1 , "The class should have 1 attribute."
492492 assert "flavors" in attrs , "The class attribute should be 'flavors'."
493- assert isinstance (solution_result .flavors , ( list , set , tuple ) ), (
493+ assert isinstance (solution_result .flavors , list | set | tuple ), (
494494 "The class attribute 'flavors' should be a datatype that acts as a container."
495495 )
496496
0 commit comments