Skip to content

Conversation

stewartHutchins
Copy link
Contributor

When completing the "generic" challengers the return type is not enforced.
e.g.

def add[T](a: T, b: T) -> T:
    return a


def add[T](a: T, b: T):
    return a

both the above functions pass the first "generic" challenge

By removing the function implementation (return a) and replacing it with ..., the 2nd function in the above code snippet becomes an invalid.

Copy link
Owner

@laike9m laike9m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@laike9m laike9m merged commit 01c4a77 into laike9m:main Sep 20, 2024
1 check passed
@stewartHutchins stewartHutchins deleted the generic-check-return-type branch September 20, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants