variable_type = type(variable)
match variable_type:
case list:
pass
case int:
pass
Been trying implement a match-case statement similar to the one above.
case list:
-> Irrefutable pattern is allowed only for the last case
case int:
-> "int" is not accessed
My current workaround has been using if-elif statements such as below, but I'm confused why the match-case statement is invalid but the if-elif works.
variable_type = type(variable)
if variable_type == list:
pass
elif variable_type == int:
pass