Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added comparison-with-callable message example #6156

Merged
merged 3 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/data/messages/c/comparison-with-callable/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fruit: str = "apple"


def function_returning_a_fruit() -> str:
return "orange"


if fruit == function_returning_a_fruit: # [comparison-with-callable]
print("apple == <function function_returning_a_fruit at 0x7f343ff0a1f0>")
Pierre-Sassoulas marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions doc/data/messages/c/comparison-with-callable/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fruit: str = "apple"


def function_returning_a_fruit() -> str:
return "orange"


if fruit == function_returning_a_fruit():
print("apple == orange")
Pierre-Sassoulas marked this conversation as resolved.
Show resolved Hide resolved