Skip to main content
Top
Published in: Empirical Software Engineering 2/2019

04-07-2018

An empirical analysis of the transition from Python 2 to Python 3

Authors: Brian A. Malloy, James F. Power

Published in: Empirical Software Engineering | Issue 2/2019

Log in

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Python is one of the most popular and widely adopted programming languages in use today. In 2008 the Python developers introduced a new version of the language, Python 3.0, that was not backward compatible with Python 2, initiating a transitional phase for Python software developers. In this paper, we describe a study that investigates the degree to which Python software developers are making the transition from Python 2 to Python 3. We have developed a Python compliance analyser, PyComply, and have analysed a previously studied corpus of Python applications called Qualitas. We use PyComply to measure and quantify the degree to which Python 3 features are being used, as well as the rate and context of their adoption in the Qualitas corpus. Our results indicate that Python software developers are not exploiting the new features and advantages of Python 3, but rather are choosing to retain backward compatibility with Python 2. Moreover, Python developers are confining themselves to a language subset, governed by the diminishing intersection of Python 2, which is not under development, and Python 3, which is under development with new features being introduced as the language continues to evolve.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Literature
go back to reference Åkerblom B, Stendahl J, Tumlin M, Wrigstad T (2014) Tracing dynamic features in Python programs. In: Working conference on mining software repositories, pp 292–295 Åkerblom B, Stendahl J, Tumlin M, Wrigstad T (2014) Tracing dynamic features in Python programs. In: Working conference on mining software repositories, pp 292–295
go back to reference Cannon B (2013) Python 3.3: Trust me, it’s better than 2.7. Pycon Cannon B (2013) Python 3.3: Trust me, it’s better than 2.7. Pycon
go back to reference Chapman C, Stolee KT (2016) Exploring regular expression usage and context in Python. In: International Symposium on software testing and analysis, pp 282–293 Chapman C, Stolee KT (2016) Exploring regular expression usage and context in Python. In: International Symposium on software testing and analysis, pp 282–293
go back to reference Chen Z, Chen L, Ma W, Xu B (2016) Detecting code smells in Python programs. In: International Conference on software analysis, testing and evolution, pp 18–23 Chen Z, Chen L, Ma W, Xu B (2016) Detecting code smells in Python programs. In: International Conference on software analysis, testing and evolution, pp 18–23
go back to reference Destefanis G, Ortu M, Porru S, Swift S, Marchesi M (2016) A statistical comparison of Java and Python software metric properties. In: International Workshop on emerging trends in software metrics, pp 22–28 Destefanis G, Ortu M, Porru S, Swift S, Marchesi M (2016) A statistical comparison of Java and Python software metric properties. In: International Workshop on emerging trends in software metrics, pp 22–28
go back to reference Dyer R, Rajan H, Nguyen HA, Nguyen TN (2014) Mining billions of AST nodes to study actual and potential usage of Java language features. In: International Conference on software engineering, pp 779–790 Dyer R, Rajan H, Nguyen HA, Nguyen TN (2014) Mining billions of AST nodes to study actual and potential usage of Java language features. In: International Conference on software engineering, pp 779–790
go back to reference Gorbovitski M, Liu YA, Stoller SD, Rothamel T, Tekle TK (2010) Alias analysis for optimization of dynamic languages. In: 6th Symposium on dynamic languages, pp 27–42 Gorbovitski M, Liu YA, Stoller SD, Rothamel T, Tekle TK (2010) Alias analysis for optimization of dynamic languages. In: 6th Symposium on dynamic languages, pp 27–42
go back to reference Hora A, Robbes R, Anquetil N, Etien A, Ducasse S, Valente MT (2015) How do developers react to API evolution? the Pharo ecosystem case. In: International Conference on software maintenance and evolution, pp 251–260 Hora A, Robbes R, Anquetil N, Etien A, Ducasse S, Valente MT (2015) How do developers react to API evolution? the Pharo ecosystem case. In: International Conference on software maintenance and evolution, pp 251–260
go back to reference Kalliamvakou E, Gousios G, Blincoe K, Singer L, German DM, Damian D (2016) An in-depth study of the promises and perils of mining GitHub. Empir Softw Eng 21(5):2035–2071CrossRef Kalliamvakou E, Gousios G, Blincoe K, Singer L, German DM, Damian D (2016) An in-depth study of the promises and perils of mining GitHub. Empir Softw Eng 21(5):2035–2071CrossRef
go back to reference Klint P, Lämmel R, Verhoef C (2005) Toward an engineering discipline for grammarware. ACM Trans Softw Eng Methodol 14(3):331–380CrossRef Klint P, Lämmel R, Verhoef C (2005) Toward an engineering discipline for grammarware. ACM Trans Softw Eng Methodol 14(3):331–380CrossRef
go back to reference Lȧmmel R (2001) Grammar adaptation. In: Formal Methods Europe, LNCS, vol 2021, pp 550–570 Lȧmmel R (2001) Grammar adaptation. In: Formal Methods Europe, LNCS, vol 2021, pp 550–570
go back to reference Lämmel R, Zaytsev V (2009) An introduction to grammar convergence. In: Integrated Formal methods, LNCS, vol 5423, pp 246- 260 Lämmel R, Zaytsev V (2009) An introduction to grammar convergence. In: Integrated Formal methods, LNCS, vol 5423, pp 246- 260
go back to reference Lin W, Chen Z, Ma W, Chen L, Xu L, Xu B (2016) An empirical study on the characteristics of Python fine-grained source code change types. In: International Conference on software maintenance and evolution, pp 188–199 Lin W, Chen Z, Ma W, Chen L, Xu L, Xu B (2016) An empirical study on the characteristics of Python fine-grained source code change types. In: International Conference on software maintenance and evolution, pp 188–199
go back to reference Ma W, Chen L, Zhang X, Zhou Y, Xu B (2017) How do developers fix cross-project correlated bugs? In: International Conference on software engineering, pp 381–392 Ma W, Chen L, Zhang X, Zhou Y, Xu B (2017) How do developers fix cross-project correlated bugs? In: International Conference on software engineering, pp 381–392
go back to reference Malloy BA, Power JF (2016) Deriving grammar transformations for developing and maintaining multiple parser versions. In: Workshop on Parsing@SLE Malloy BA, Power JF (2016) Deriving grammar transformations for developing and maintaining multiple parser versions. In: Workshop on Parsing@SLE
go back to reference Malloy BA, Power JF (2017) Quantifying the transition from Python 2 to 3: an empirical study of Python applications. In: ACM/IEEE International symposium on empirical software engineering and measurement Malloy BA, Power JF (2017) Quantifying the transition from Python 2 to 3: an empirical study of Python applications. In: ACM/IEEE International symposium on empirical software engineering and measurement
go back to reference Malloy BA, Linde SA, Duffy EB, Power JF (2002a) Testing C++ compilers for ISO language conformance. Dr Dobb’s J 27(6):71–80 Malloy BA, Linde SA, Duffy EB, Power JF (2002a) Testing C++ compilers for ISO language conformance. Dr Dobb’s J 27(6):71–80
go back to reference Malloy BA, Power JF, Waldron JT (2002b) Applying software engineering techniques to parser design: the development of a C# parser. In: Conference of the South African institute of computer scientists and information technologists. Port Elizabeth, pp 75–82 Malloy BA, Power JF, Waldron JT (2002b) Applying software engineering techniques to parser design: the development of a C# parser. In: Conference of the South African institute of computer scientists and information technologists. Port Elizabeth, pp 75–82
go back to reference Malloy BA, Gibbs TH, Power JF (2003) Progression toward conformance for C++ language compilers. Dr Dobb’s J 28(11):54–60 Malloy BA, Gibbs TH, Power JF (2003) Progression toward conformance for C++ language compilers. Dr Dobb’s J 28(11):54–60
go back to reference Memarian K, Matthiesen J, Lingard J, Nienhuis K, Chisnall D, Watson RNM, Sewell P (2016) Into the depths of C: elaborating the de facto standards. In: Programming Language design and implementation, pp 1–15 Memarian K, Matthiesen J, Lingard J, Nienhuis K, Chisnall D, Watson RNM, Sewell P (2016) Into the depths of C: elaborating the de facto standards. In: Programming Language design and implementation, pp 1–15
go back to reference Orrù M, Tempero E, Marchesi M, Tonelli R, Destefanis G (2015a) A curated benchmark collection of Python systems for empirical studies on software engineering. In: International Conference on predictive models and data analytics in software engineering, pp 2:1–2:4 Orrù M, Tempero E, Marchesi M, Tonelli R, Destefanis G (2015a) A curated benchmark collection of Python systems for empirical studies on software engineering. In: International Conference on predictive models and data analytics in software engineering, pp 2:1–2:4
go back to reference Orrù M, Tempero ED, Marchesi M, Tonelli R (2015b) How do Python programs use inheritance? A replication study. In: Asia-Pacific Software engineering conference, pp 309–315 Orrù M, Tempero ED, Marchesi M, Tonelli R (2015b) How do Python programs use inheritance? A replication study. In: Asia-Pacific Software engineering conference, pp 309–315
go back to reference Parnin C, Bird C, Murphy-Hill E (2011) Java generics adoption: how new features are introduced, championed, or ignored. In: Working Conference on mining software repositories, pp 3–12 Parnin C, Bird C, Murphy-Hill E (2011) Java generics adoption: how new features are introduced, championed, or ignored. In: Working Conference on mining software repositories, pp 3–12
go back to reference Power JF, Malloy BA (2004) A metrics suite for grammar-based software. Softw Mainten Evol 16(6):405–426CrossRef Power JF, Malloy BA (2004) A metrics suite for grammar-based software. Softw Mainten Evol 16(6):405–426CrossRef
go back to reference Sharma P, Savarimuthu BTR, Stanger N, Licorish SA, Rainer A (2017) Investigating developers’ email discussions during decision-making in Python language evolution. In: International Conference on evaluation and assessment in software engineering. ACM, New York, pp 286–291 Sharma P, Savarimuthu BTR, Stanger N, Licorish SA, Rainer A (2017) Investigating developers’ email discussions during decision-making in Python language evolution. In: International Conference on evaluation and assessment in software engineering. ACM, New York, pp 286–291
go back to reference Sipser M (2012) Introduction to the theory of computation. Cengage Learning Sipser M (2012) Introduction to the theory of computation. Cengage Learning
go back to reference Tempero E, Anslow C, Dietrich J, Han T, Li J, Lumpe M, Melton H, Noble J (2010) Qualitas corpus: a curated collection of Java code for empirical studies. In: Asia Pacific Software engineering conference, pp 336–345 Tempero E, Anslow C, Dietrich J, Han T, Li J, Lumpe M, Melton H, Noble J (2010) Qualitas corpus: a curated collection of Java code for empirical studies. In: Asia Pacific Software engineering conference, pp 336–345
go back to reference Toal R, Rivera R, Schneider A, Choe E (2016) Programming language explorations. CRC Press Toal R, Rivera R, Schneider A, Choe E (2016) Programming language explorations. CRC Press
go back to reference Urma RG (2017) Programming language evolution. Tech. Rep UCAM-CL-TR-902. Univ. of Cambridge, Computer Laboratory Urma RG (2017) Programming language evolution. Tech. Rep UCAM-CL-TR-902. Univ. of Cambridge, Computer Laboratory
go back to reference Urma RG, Orchard D, Mycroft A (2014) Programming language evolution workshop report. In: Workshop on programming language evolution, pp 1–3 Urma RG, Orchard D, Mycroft A (2014) Programming language evolution workshop report. In: Workshop on programming language evolution, pp 1–3
go back to reference Wang B, Chen L, Ma W, Chen Z, Xu B (2015) An empirical study on the impact of Python dynamic features on change-proneness. In: International Conference on software engineering and knowledge engineering, pp 134–139 Wang B, Chen L, Ma W, Chen Z, Xu B (2015) An empirical study on the impact of Python dynamic features on change-proneness. In: International Conference on software engineering and knowledge engineering, pp 134–139
go back to reference Zaytsev V (2014) Negotiated grammar evolution. J Object Technol 13(3):1,1–22CrossRef Zaytsev V (2014) Negotiated grammar evolution. J Object Technol 13(3):1,1–22CrossRef
Metadata
Title
An empirical analysis of the transition from Python 2 to Python 3
Authors
Brian A. Malloy
James F. Power
Publication date
04-07-2018
Publisher
Springer US
Published in
Empirical Software Engineering / Issue 2/2019
Print ISSN: 1382-3256
Electronic ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-018-9637-2

Other articles of this Issue 2/2019

Empirical Software Engineering 2/2019 Go to the issue

Premium Partner