Hard to Read and Understand Pythonic Idioms? DeIdiom and Explain Them in Non-Idiomatic Equivalent Code

Appendices:

Appendices.pdf is the supplementary document.

Web application:

We develop a web application for demostration of deidioming pythonic code into explanatory non-idiomatic code to enhance the readability of nine pythonic idioms (list/set/dict-comprehension, chain-comparison, truth-value-test, loop-else, assign-multiple-targets, for-multiple-targets and star). Please visit https://zzj.pythonanywhere.com/. Note: the original url(http://35.77.46.3:5000) has not been maintained.

Code:

1). code/extract_idiom_code_new:
  
    Extracting idiomatic code for nine pythonic idioms.

2).  code/transform_s_c: 

    Refactoring idiomatic code into non-idiomatic code for nine pythonic idioms.

3).  ./code/test_case_idiom_s_c:
 
    Configuring projects and executing test cases for nine pythonic idioms.

Data:

1). data/all_idiomatic_to_nonidiomatic/:
  
    All code pairs of idiomatic code and the corresponding non-idiomatic code for nine pythonic idioms.

2). data/motivation/: 

    All results of Section 2 (EMPRICAL STUDY).

3).  data/effectiveness/:
 
    All results of Section 4.1 (Refactoring Accuracy).

4). data/survey/: 

    The notes documentation, all questions, and answers of 20 participants of Section 4.2 (Refactoring Usefulness). 

If the work is helpful to you, please cite the paper

@inproceedings{deidiom, author = {Zhang, Zejun and Xing, Zhenchang and Zhao, Dehai and Lu, Qinghua and Xu, Xiwei and Zhu, Liming}, title = {Hard to Read and Understand Pythonic Idioms? DeIdiom and Explain Them in Non-Idiomatic Equivalent Code}, year = {2024}, isbn = {979-8-4007-0217-4/24/04}, publisher = {Association for Computing Machinery}, address = {New York, NY, USA}, url = {https://doi.org/10.1145/3597503.3639101}, doi = {10.1145/3597503.3639101}, booktitle = {2024 IEEE/ACM 46th International Conference on Software Engineering (ICSE '24)}, pages = {}, numpages = {12}, location = {, Lisbon, Portugal, }, series = {ICSE 2024} }