Python is a well-known dynamically-typed programming language. Due to its dynamic type, Python is flexible to solve complex situations. However, the use of dynamic type may cause many problems on correctness, security and performance. In this paper, we make an empirical study on the dynamic type of Python. First, we collect a dataset with 81 categories from the project list of Awesome Python. Then all Python files in this dataset are analyzed by Pysonar2. Type information is collected and saved for each identifier. Next, we proposed to recognize the dynamic type by comparing the analysis results from Pysonar2. After that, two research questions are put up to investigate the popularity of Python dynamic type in actual programming and the patterns of dynamic type for Python variables. The results show that 6.9% of identifiers in this dataset involve dynamic type and 79.7% of identifiers do not involve dynamic type. Besides, the patterns of dynamic type mainly appear among Transfer assignment methods. Finally, our results give implications such as optimization of naming space to improve the design of Python type system.
CITATION STYLE
Xia, X., He, X., Yan, Y., Xu, L., & Xu, B. (2018). An Empirical Study of Dynamic Types for Python Projects. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 11293 LNCS, pp. 85–100). Springer Verlag. https://doi.org/10.1007/978-3-030-04272-1_6
Mendeley helps you to discover research relevant for your work.