Python
Dictionary creation can be rewritten by dictionary literal
Info
New
Last modified: 03 December 2024Reports situations when you can rewrite dictionary creation by using a dictionary literal.
This approach brings performance improvements.
Example:
dic = {}
dic['var'] = 1
When the quick-fix is applied, the code changes to:
dic = {'var': 1}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
PyDictCreation
Inspection Details | |
---|---|
By default bundled with: | CLion 2024.3, IntelliJ IDEA 2024.3, PyCharm 2024.3, Qodana for JVM 2024.3, |
Can be installed with plugin: | Python Community Edition, 243.23126 |
Thanks for your feedback!
Was this page helpful?