norminette
This commit is contained in:
@@ -4,7 +4,8 @@ def all_thing_is_obj(object: any) -> int:
|
||||
|
||||
# https://docs.python.org/3.10/tutorial/controlflow.html#match-statements
|
||||
match object:
|
||||
# class patterm : check against a class (check if instance when empty arguments) https://docs.python.org/3/reference/compound_stmts.html#class-patterns
|
||||
# class pattern, against a class (or instance if empty arguments):
|
||||
# https://docs.python.org/3/reference/compound_stmts.html#class-patterns
|
||||
case list():
|
||||
print("List : ", ofType)
|
||||
case tuple():
|
||||
@@ -17,4 +18,4 @@ def all_thing_is_obj(object: any) -> int:
|
||||
print(object + " is in the kitchen : ", ofType)
|
||||
case _:
|
||||
print("Type not found")
|
||||
return 42
|
||||
return 42
|
||||
|
||||
@@ -3,7 +3,7 @@ from find_ft_type import all_thing_is_obj
|
||||
ft_list = ["Hello", "tata!"]
|
||||
ft_tuple = ("Hello", "toto!")
|
||||
ft_set = {"Hello", "tutu!"}
|
||||
ft_dict = {"Hello" : "titi!"}
|
||||
ft_dict = {"Hello": "titi!"}
|
||||
|
||||
all_thing_is_obj(ft_list)
|
||||
all_thing_is_obj(ft_tuple)
|
||||
@@ -11,4 +11,4 @@ all_thing_is_obj(ft_set)
|
||||
all_thing_is_obj(ft_dict)
|
||||
all_thing_is_obj("Brian")
|
||||
all_thing_is_obj("Toto")
|
||||
print(all_thing_is_obj(10))
|
||||
print(all_thing_is_obj(10))
|
||||
|
||||
Reference in New Issue
Block a user