Lune

FSE2022Top-tier venue

An exploratory study on the predominant programming paradigms in Python code

Robert Dyer, Jigyasa Chauhan

Abstract

Python is a multi-paradigm programming language that fully supports object-oriented (OO) programming. The language allows writing code in a non-procedural imperative manner, using procedures, using classes, or in a functional style. To date, no one has studied what paradigm(s), if any, are predominant in Python code and projects. In this work, we first define a technique to classify Python files into predominant paradigm(s). We then automate our approach and evaluate it against human judgements, showing over 80% agreement. We then analyze over 100k open-source Python projects, automatically classifying each source file and investigating the paradigm distributions. The results indicate Python developers tend to heavily favor OO features. We also observed a positive correlation between OO and procedural paradigms and the size of the project. And despite few files or projects being predominantly functional, we still found many functional feature uses.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • A Study on the Pythonic Functional Constructs' Understandability cites Why Do Developers Remove Lambda Expressions in Java?
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Are Prompt Engineering and TODO Comments Friends or Foes? An Evaluation on GitHub CopilotDavid O'Brien, Sumon Biswas, Sayem Mohammad Imtiaz, Rabe Abdalkareem et al.ICSE 2024 · 7 citations
  2. A Study on the Pythonic Functional Constructs' UnderstandabilityCyrine Zid, Fiorella Zampetti, Giuliano Antoniol, Massimiliano Di PentaICSE 2024 · 4 citations

Builds on1

  1. Why Do Developers Remove Lambda Expressions in Java?Mingwei Zheng, Jun Yang, Ming Wen, Hengcheng Zhu et al.ASE 2021 · 9 citations

Related papers

  1. Static Type Recommendation for PythonKe Sun, Yifan Zhao, Dan Hao, Lu ZhangASE 2022 · 6 citations
  2. An Empirical Evaluation of Property-Based Testing in PythonSavitha Ravi, Michael CoblenzOOPSLA 2025 · 4 citations
  3. Faster or Slower? Performance Mystery of Python Idioms Unveiled with Empirical EvidenceZejun Zhang, Zhenchang Xing, Xin Xia, Xiwei Xu et al.ICSE 2023 · 16 citations
  4. An Empirical Study on Package-Level Deprecation in Python EcosystemZhiqing Zhong, Shilin He, Haoxuan Wang, Boxi Yu et al.ICSE 2025 · 3 citations
  5. Discovering Parallelisms in Python ProgramsSiwei Wei, Guyang Song, Senlin Zhu, Ruoyi Ruan et al.FSE 2023 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines