I'm running Python 3.7.9 and I have a line of code like this:
mom = get_mom()
if mom:
print(f"{mom}'s here!")
And it's prompting with the message ("Use named expression to simplify assignment and conditional (use-named-expression)") to refactor using walrus operator as:
Hi @x-N0, thanks for raising the issue. We have instructions for this specific situation in the sourcery docs - check them out here. I'll close the issue for now, but if you're still having problems feel free to re-open.
Issue description or question
I'm running Python 3.7.9 and I have a line of code like this:
And it's prompting with the message ("Use named expression to simplify assignment and conditional (use-named-expression)") to refactor using walrus operator as:
Walrus was added at v3.8.
Sourcery Version
0.12.7
Code editor or IDE name and version
Pycharm: 2021.2.2
OS name and version
Linux on Linux 5.10.136-1