I've taken care to make sure library works on both python2 and python3, but pycharm adds some vexatious red squiggles as seen below
If I switch the project interpreter to python 3.5 instead, the nag just moves onto the other import. Which inspection is this? I want to turn it off.
Although it doesn't solve the issue for all cases, you can solve this particular problem by using the future
package.
As you can see here, the future
package provides its own version of builtins
for python 2 and python 3. By relying on this package instead of doing it yourself, you can import future
's implementation of builtins, thus removing the problematic code and avoiding Pycharm's (erroneous) error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With