Complex Python Features in the Wild

While Python is increasingly popular, program analysis tooling for Python is lagging. This is due, in part, to complex features of the Python language-features with difficult to understand and model semantics. Besides the "usual suspects", reflection and dynamic execution, complex Python f...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:2022 IEEE/ACM 19th International Conference on Mining Software Repositories (MSR) S. 282 - 293
Hauptverfasser: Yang, Yi, Milanova, Ana, Hirzel, Martin
Format: Tagungsbericht
Sprache:Englisch
Veröffentlicht: ACM 01.05.2022
Schlagworte:
ISSN:2574-3864
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:While Python is increasingly popular, program analysis tooling for Python is lagging. This is due, in part, to complex features of the Python language-features with difficult to understand and model semantics. Besides the "usual suspects", reflection and dynamic execution, complex Python features include context managers, decorators, and generators, among others. This paper explores how often and in what ways developers use certain complex features. We analyze over 3 million Python files mined from GitHub to address three research questions: (i) How often do developers use certain complex Python features? (ii) In what ways do developers use these features? (iii) Does use of complex features increase or decrease over time? Our findings show that usage of dynamic features that pose a threat to static analysis is infrequent. On the other hand, usage of context managers and decorators is surprisingly widespread. Our actionable result is a list of Python features that any "minimal syntax" ought to handle in order to capture developers' use of the Python language. We hope that understanding the usage of Python features will help tool-builders improve Python tools, which can in turn lead to more correct, secure, and performant Python code.
ISSN:2574-3864
DOI:10.1145/3524842.3528467