Skip to content

Commit fe6c0f2

Browse files
matusvalosprytnykPierre-Sassoulas
authored
Added comparison-with-callable message example (#6156)
Co-authored-by: Vladyslav Krylasov <[email protected]> Co-authored-by: Pierre Sassoulas <[email protected]>
1 parent ce42d69 commit fe6c0f2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def function_returning_a_fruit() -> str:
2+
return "orange"
3+
4+
def is_an_orange(fruit: str = "apple"):
5+
# apple == <function function_returning_a_fruit at 0x7f343ff0a1f0>
6+
return fruit == function_returning_a_fruit # [comparison-with-callable]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
def function_returning_a_fruit() -> str:
2+
return "orange"
3+
4+
def is_an_orange(fruit: str = "apple"):
5+
# apple == orange
6+
return fruit == function_returning_a_fruit()

0 commit comments

Comments
 (0)