Code Assistance for Type Defaults for Type Parameters, and New Django features
You can now look at n-dimensional NumPy arrays in the Data View tool window. Define the array you would like to inspect, along with a specific dimension or slice, in a special field at the bottom of the tool window, and PyCharm will display a table with the results. Note that the field only recognizes single quotes when you add conditions for the array’s display.
Python 3.13 brings the ability to define the default types for type parameters, such as TypeVar
, ParamSpec
, and TypeVarTuple
, along with a new syntax for defining them.
PyCharm now supports default types for type parameters for both old-style and new-style generic classes, functions, and type aliases, and it takes them into account in type inference.
When working with models, PyCharm now offers field completion suggestions in a variety of cases, such as Model.save(update_fields[...])
, Model.refresh_from_db(fields=[...])
, Model.clean_fields(exclude=[...])
, and so on.
PyCharm now correctly infers the type of <related_field>_id
attributes in Django models based on the primary key type of the related model. This ensures that type hints are accurate when you're working with foreign key fields in Django projects, improving code quality and type safety.