Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python warning print expression is assigned to nothing

I'm using Syntastic in vim as a linter for Python3. I have a few warnings that my print statements are expressions that are not assigned to anything:

[expression-not-assigned] Expression "(print(('Authenticated for Twitter user ') + (twitter_api.VerifyCredentials().screen_name)), )" is assigned to nothing
[expression-not-assigned] Expression "(print('Deleting Twitter posts.'),     )" is assigned to nothing

These are just simple print statements so I'm curious why I'm seeing these warnings and how I would go about resolving them.

like image 739
Alex Waibel Avatar asked Apr 18 '26 04:04

Alex Waibel


1 Answers

Remove the outer parenthesizes and everything should be fine.

print('Authenticated for Twitter user %s' % twitter_api.VerifyCredentials().screen_name)
print('Deleting Twitter posts.')
like image 62
Dunedan Avatar answered Apr 19 '26 21:04

Dunedan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!