网页 综合 更新时间 2026-11-13 00:00:00

What’s Fixed and Improved in PyCharm 2026.3 - The JetBrains Blog

自动蜘蛛 blog.jetbrains.com 正文约 6000 字
What’s Fixed and Improved in PyCharm 2026.3 - The JetBrains Blog
The only Python IDE you need.
PyCharm 2026.3 is here! Alongside major features like JetBrains Air, workspaces, Python 3.15 lazy imports, and the redesigned interpreter widget, this release includes 303 fixes and improvements to everyday Python development.
From smarter code completion to more reliable environments and debugging, here are some of the changes worth knowing about—including fixes for issues reported more than a decade ago.
functools.partial lets you create a new callable by supplying some of a function’s arguments in advance. Previously, PyCharm could struggle to infer the resulting signature, leading to missing parameter information and incorrect warnings.
PyCharm now understands the remaining parameters, checks their types, and recognizes partial objects as valid Callable instances. In the example below, PyCharm correctly identifies the remaining parameter and flags an incompatible argument.
PyCharm understands the remaining parameters of a functools.partial object.
This resolves several long-standing issues with completion, parameter information, and type checking (PY-35363, PY-33618, PY-25698, PY-36385).
PyCharm now provides more accurate type inference for generic classes, bounded and constrained type variables, overloaded constructors, and generic __getattr__ methods. For example, calling a method on a bounded type variable now preserves its return type instead of falling back to Any (PY-89863).
Collection inference has improved, too. Nested lists, optional values, dictionary literals, and tuple unpacking produce fewer false warnings (PY-89564, PY-91999). There are also improvements to Literal, Enum, and TypedDict, along with support for PEP 747’s TypeForm[T] and intersection types through ty_extensions.Intersection (PY-90287, PY-62524, PY-89043, PY-87024).
When PyCharm finds a type mismatch, its tooltips now provide clearer explanations, improved formatting, and links to the relevant types. Call and control-flow analysis also handles more cases involving optional callables, bound methods, and paths that never return, reducing false warnings (PY-90555, PY-83644).
When a warning is intentional, you have more control over suppressing it. PyCharm now supports shorter codes in # type: ignore[...] comments and introduces # pycharm: ignore[...] for individual PyCharm inspections. There’s also a Suppress with ‘type: ignore’ comment action, and unknown suppression codes are flagged to catch typos (PY-90787, PY-92114).
PyCharm 2026.3 introduces a new action to suppress individual type warnings using # type: ignore[...] comments.
Mocks and fixtures can be tricky for an IDE to understand. PyCharm now provides completion for the pytest-mock mocker fixture, navigation for mocker.patch() targets, and completion based on classes passed to Mock(spec=...) or Mock(spec_set=...).
PyCharm 2026.3 provides completion for methods defined in classes passed to Mock(spec=...).
PyCharm also flags invalid unittest.mock.patch() targets and improves completion and documentation for pytest fixtures (PY-36260, PY-32282).
For projects with custom test infrastructure, you can configure a unittest runner script, such as Django’s tests/runtests.py. If it uses unittest.TextTestRunner, test results appear in PyCharm’s test tree (PY-26068).
Zuban, a mypy-compatible type checker and language server, joins ty, Pyrefly, and basedpyright as a supported external tool. Its integration provides diagnostics, completion, hover information, inlay hints, and quick fixes. Pyrefly also receives fixes for custom import roots and missing-package installation (PY-85009, PY-89805).
With Ruff, Optimize Imports now removes unused imports and organizes them. Ruff fixes can run automatically on save or before a commit, and the new Apply Ruff Fixes action works across a selected scope, including an entire project. Configuration discovery is also more reliable in multi-root, network, and WSL projects (PY-85534, PY-86352).
Apply Ruff fixes to an individual file, custom scope, or entire project directly from PyCharm.
Django: You can create run configurations for Django 6.0 tasks, and TextChoices members defined with value-and-label tuples no longer trigger false type errors (PY-86368, PY-92177).
In Django REST framework, rest_framework.reverse.reverse() now offers URL-name completion and navigation, just like Django’s built-in reverse() (PY-78900).
PyCharm 2026.3 provides URL-name completion for Django REST framework’s reverse() function.
FastAPI: Alongside the new interactive dependency graphs, path parameters supplied through dependencies no longer cause incorrect warnings about missing endpoint parameters (PY-88935).
SQLAlchemy: Expanded ORM support improves completion, navigation, and type inference for declarative models. Fixes also cover attributes added through relationship() and columns that use SQLAlchemy’s ENUM type (PY-79736, PY-29212).
Several small fixes make editing more predictable. Pressing Enter after a comment introducing a block now inserts the correct indentation, while moving lines in tab-indented files no longer causes false Unexpected indent warnings (PY-15693, PY-78251).
A new Align consecutive assignments formatter option lines up assignment operators. You can enable it under Settings | Editor | Code Style | Python | Wrapping and Braces. The formatter also does a better job preserving configured blank lines (PY-34006).
Refactoring is safer, too. Inline Function preserves fallback behavior for omitted optional arguments, while Implement abstract methods generates valid implementations of asynchronous abstract methods (PY-81983, PY-53074).
conda: Environment variables configured using conda env config vars set or activate.d scripts are now available when you run scripts, tests, and the Python console from PyCharm. Previously, variables could work in a terminal but be missing inside the IDE—particularly frustrating for projects using GDAL, QGIS, PyMC, or compiler toolchains (PY-55405, PY-38751).
uv: Workspaces
访问原文 返回搜索 https://blog.jetbrains.com/pycharm/2026/11/what-s-fixed-and-improved-in-pycharm-2026-3/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。