Treffer: RIdiom: Automatically Refactoring Non-Idiomatic Python Code with Pythonic Idioms.

Title:
RIdiom: Automatically Refactoring Non-Idiomatic Python Code with Pythonic Idioms.
Source:
ICSE: International Conference on Software Engineering; 2023, p102-106, 5p
Company/Entity:
Database:
Complementary Index

Weitere Informationen

Pythonic idioms are widely adopted in the Python community because of their advantages such as conciseness and performance. However, when Python programmers use pythonic idioms, they face many challenges such as being unaware of certain pythonic idioms or not knowing how to use them properly. Based on an analysis of 7,638 Python repositories on GitHub, we find that non-idiomatic Python code that can be refactored with pythonic idioms occurs frequently and widely. Unfortunately, there is no tool to automatically refactor such non-idiomatic code into idiomatic code. In this paper, we design and implement a tool called RIdiom to make Python code idiomatic with nine pythonic idioms. Python developers can not only refactor projects easily via a visual interface of the PyCharm plugin but also can refactor projects using the command line without relying on an integrated development environment. We test and review over 4,115 refactorings applied to 1,065 Python projects from GitHub, and submit 90 pull requests for the 90 randomly sampled refactorings to 84 projects. These evaluations confirm the high-accuracy, practicality and usefulness of our refactoring tool on real-world Python code. Demo Tool: https://github.com/idiomaticrefactoring/RIdiom Demo Video: https://youtu.be/KG-nXGR8DIA [ABSTRACT FROM AUTHOR]

Copyright of ICSE: International Conference on Software Engineering is the property of Association for Computing Machinery and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)