-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added comparison-with-callable message example (#6156)
Co-authored-by: Vladyslav Krylasov <[email protected]> Co-authored-by: Pierre Sassoulas <[email protected]>
- Loading branch information
1 parent
ce42d69
commit fe6c0f2
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def function_returning_a_fruit() -> str: | ||
return "orange" | ||
|
||
def is_an_orange(fruit: str = "apple"): | ||
# apple == <function function_returning_a_fruit at 0x7f343ff0a1f0> | ||
return fruit == function_returning_a_fruit # [comparison-with-callable] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def function_returning_a_fruit() -> str: | ||
return "orange" | ||
|
||
def is_an_orange(fruit: str = "apple"): | ||
# apple == orange | ||
return fruit == function_returning_a_fruit() |