-
-
Couldn't load subscription status.
- Fork 3k
Closed
Labels
Description
def is_prime(n):
# type: (int) -> bool
return all(n % p != 0 for p in range(2, n))
def is_palindrome(m):
# type: (int) -> bool
return str(m) == ''.join(reversed(str(m)))
list1 = [is_prime, is_palindrome]
list2 = [is_prime, is_prime]
reveal_type(list1)
reveal_type(list2)In this code, is_prime and is_palindrome have the same signature def (builtins.int) -> builtins.bool but different parameter names.
These are the revealed types:
list1:builtins.list[builtins.function*]list2:builtins.list[def (n: builtins.int) -> builtins.bool]
I think the type of list1 should have been builtins.list[def (builtins.int) -> builtins.bool].