PyCharm 2022.2: Support for Python 3.11, Improved HTTP Client, and UX Enhancements
Working with new and rapidly evolving technologies can be challenging as you often find yourself reading documentation and getting used to new syntax, APIs, and protocols. PyCharm 2022.2 will help you in this journey by providing support for Python 3.11 language features and the new PyScript framework.
Let’s look at what’s inside!
PyCharm 2022.2 is already equipped with code insight for some major Python 3.11 features, such as exception groups and the except* operator (PEP 654), and the new Requiredand NotRequirednotations for individual TypedDict keys (PEP 655).
PyCharm 2022.2 supports WebSocket connections. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. PyCharm can now send queries over HTTP and WebSocket protocols out of the box. ws:// and wss:// are now delegated to the WebSocket executor.
In addition, there’s an easier way to select a run environment – by using an icon on the gutter. To enable this feature, choose the Select Environment Before Run option from the Run with combo box.
A new UI for setting up remote interpreters
PyCharm 2022.2 introduces a new wizard for setting up interpreters at remote targets (such as WSL, SSH, Docker, Docker Compose, or Vagrant). It makes the setup process more structured and easy to follow. To access the new wizard, go to Settings | Preferences / Python Interpreter and click the Add Interpreter link in the top right-hand corner of the window, or click on the interpreter in the bottom right-hand corner of the editor and select Add New Interpreter.
Run current file
To instantly run and debug a single file without a dedicated run configuration, use Run Current File, which is available from the Run/Debug widget. It features a secondary menu that offers applicable runners along with the Run with Parameters action, which lets you tune the run configuration parameters before running the file.
Initial support for PyScript
The <py-script> tag lets you execute multiline Python scripts and interact with the page. PyCharm 2022.2 recognizes Python syntax, including NumPy and Matplotlib libraries, for code inside <py-script> tags in HTML files and provides proper code completion and highlighting for it.
Code completion and syntax highlighting are now available for PyScript tags such as <py-env> for declaring dependencies and <py-repl> for creating REPL components.
PyCharm 2022.2 enhances your user experience with Jupyter notebooks. You can now cut, copy, and paste cells more easily by using the corresponding buttons and icons in the Jupyter editor toolbar.
You can also resize image outputs by simply dragging the output’s bottom border. This should improve the readability of such outputs.
PyCharm 2022.2 lets you import multiple CSVs into new or existing database tables. To do so, select multiple files in the Project View and drag them to a database schema.
There are two resolve modes for your SQL scripts in PyCharm 2022.2. In Playground mode, objects are resolved according to the context. It is now the default for query consoles. In Script mode, the beginning of the file is resolved to the context, but any SET CURRENT SCHEMA statements in the script change the context for the resolve. Script mode is now the default for local files. To switch between the modes, just use the drop-down on the toolbar.
You can now easily copy images from one Docker daemon to another using the new Copy Docker Image action that saves the image to a file and then pushes it to the chosen connection. PyCharm also integrates with Colima and Racher to support more options for establishing connections to a Docker daemon.
In addition, PyCharm 2022.2 automatically connects to Docker after you restart the IDE. This new setting is enabled by default and can be switched in Settings / Preferences | Advanced Settings | Docker.
The PyCharm team