9

I have a big Python 2 project that I want to port to Python 3. As per the porting guide I want to become Python 2/3 compatible first. This would mean writing Python 3 compatible code in Python 2. Is there a way to tell PyCharm to turn on Python 3 code checking in a Python 2 project?

12

I use the Python Community Edition extension in IDEA, currently version 5.1.145.45. Open Settings. Under Editor -> Inspections find the section in the center pane for "Python" there is now a setting for "Code compatibility inspection" where you can choose the python versions to inspect.

I haven't looked lately but the PyCharm settings should be identical.

  • 2
    Instead of "Settings" it's "Preferences" – jcmack Oct 1 '18 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.