Papers for

python developers

Papers whose findings have a practical use for this group, as judged from the abstract. Open a paper to read what it means in practice.

Typify infers precise Python types faster without annotations

Typify: A Tool for Usage-driven Type Inference in Python

Abstract: Python's dynamic type system, while expressive and flexible, creates significant challenges for static analysis tools in unannotated or partially annotated codebases. Existing approaches either require pre-existing type annotations, or depend on deep learning models that demand large training corpora and significant computational resources. We present Typify, a lightweight, usage-driven static type inference engine that infers precise type information across entire Python projects without annotations or training data. Typify integrates symbolic execution, fixpoint analysis, and context-matching retrieval to propagate types across modules, functions, and recursive call structures. The tool is available as both a command-line interface (CLI) for batch inference, evaluation and downstream integration with other tools, and a Visual Studio Code (VS Code) extension for interactive type assistance. Evaluation on the ManyTypes4Py and Typilus datasets shows that Typify outperforms all static baselines and closely matches state-of-the-art hybrid deep learning approaches, while running approximately 10x faster.

Wed 11 NovSoftware Engineering
The gist
Python’s flexibility with types makes it hard for tools to understand code before running it, especially without type hints. The authors developed Typify, a tool that guesses types by examining how code uses values, without needing extra information or training on large datasets. Typify combines techniques like symbolic execution and analysis of function calls to predict types accurately across projects. Tests show it works better than existing static methods and almost as well as heavier AI-based tools, but much faster.
Open → 2611.14879v1

Analysis of Python linters reveals rule overlap and performance differences

Understanding Python Linters through a Comprehensive and Systematic Empirical Study

Abstract: Code linters, tools that automatically detect code issues, help developers accelerate development and improve code quality by identifying errors early. Unlike previous studies that focused mainly on single linters or informal comparisons, this paper presents the first large-scale empirical study of five widely used Python linters: Ruff, Pylint, Flake8, Mypy and Black, through four key user concerns: linting rule checks, speed, configuration methods, and linter preferences. We analyze 1,551 linting rules, categorize them into five types, and construct rule mappings, finding that more than 40% are shared between multiple linters, with Ruff and Pylint together covering over 80% of all rules. Pylint has the most rules in the first two categories, and Ruff leads in the last three. Next, we measure their running times on 1,000 GitHub projects under three setups (single-rule, default, all-rules), finding a consistent speed ranking from fastest to slowest: Ruff, Mypy, Flake8, Black, and Pylint. Ruff is extremely fast, with runtimes typically within one second. Then, we summarize four configuration methods and four types of configuration options from 443 available options across the five linters. While all linters support the four configuration methods, they differ in project configuration formats and flexibility in their configuration options. Finally, an analysis of 3,094 GitHub projects using the five linters reveals that over 50% use multiple linters, share strong consensus on option selections and rule suppressions, but exhibit project-specific variations in enabled-rule configurations. Our findings provide actionable insights for linter users and establish a benchmark dataset and taxonomy to support future research, such as cross-linter rule mapping, performance modeling, and automated configuration.

Mon 26 OctSoftware Engineering
The gist
Code linters are tools that help programmers find and fix mistakes faster. The authors studied five popular Python linters to see how their checks, speed, and settings compare. They found many rules are shared among linters, especially Ruff and Pylint, with Ruff being the fastest. They also looked at how people configure and combine linters in real projects. This study helps users pick and set up linters better and supports future tool improvements.
Open → 2610.35485v1

Dynamic analysis improves generation of github actions workflows

DynaCI: Generating GitHub Actions Workflows via Dynamic Analysis

Abstract: Continuous Integration (CI) is an essential practice that automatically validates code changes through builds and tests. However, configuring CI workflows remains challenging, as modern software often features complex architectures, numerous dependencies, and support for diverse execution environments. Most CI platforms also require workflows to be written in their particular domain-specific languages. As a result, CI workflows are often error-prone and hard to maintain, especially for those unfamiliar with CI semantics. Prior work on automated CI workflow generation require developers to create specifications that describe their intended workflows using natural language, partial workflows, etc. However, in practice, developers may struggle to articulate requirements and may be unaware of available CI features. To address these limitations, we propose DynaCI, a novel approach that uses runtime information from developers' local environments to generate CI workflows. DynaCI (i) traces the developers' local environment to collect runtime information, (ii) constructs an initial workflow by applying runtime-informed heuristics, and (iii) iteratively refines the workflow via LLM-based Retrieval Augmented Generation (RAG). We evaluate DynaCI on 50 popular Python projects that use GitHub Actions, a popular CI platform, and compare it against the state-of-the-art CI workflow generation approaches: GH-WCOM and LLM4GW. DynaCI outperforms these existing approaches by more than 21.13% in BLEU score and 20.96% in F1 score on average. It also generates workflows without missing functionality in 56% of cases, while requiring fewer manual modifications to repair such exceptions. These results demonstrate that leveraging runtime information substantially improves LLM-based CI workflow generation, and offer a promising direction for broader DevOps configuration automation.

Wed 21 OctSoftware Engineering
The gist
Setting up automated tests and builds for software projects is hard because it involves many complex steps. The authors created a tool called DynaCI that watches what happens when developers run code on their own computers to automatically build these setups. DynaCI then uses a type of AI to improve these setups step-by-step, making them more accurate and easier to maintain. Tests on popular Python projects showed DynaCI makes fewer mistakes and needs less fixing compared to previous tools. This approach could help developers get continuous integration ready without deep knowledge of the underlying systems.
Open → 2610.29890v1

Standards guided approach improves code documentation quality

Standards-Guided and Dependency-Aware Code-Level Documentation Generation

Abstract: Automatically generating high-quality documentation for software repositories remains challenging: existing approaches largely treat documentation as unconstrained text generation, lacking explicit quality specifications, depending heavily on long-context prompts over raw code, and offering limited support for reproducible evaluation. We argue that code-level documentation generation should instead be a standards-guided software engineering task, in which documentation is generated and assessed against explicit, reusable quality requirements derived from authoritative standards. We define code documentation as natural-language descriptions of repository functions and classes, organized by source-code path. We present CODEDOC, a standards-guided and dependency-aware framework that identifies dependencies between code entities via static call-graph and AST analysis and constructs dependency-aware structured prompts combining local code context, repository paths, and documentation criteria drawn from authoritative standards and style guides. We further introduce an interactive LLM-as-a-judge protocol that supplies criterion-aligned feedback to refine generated documentation along fine-grained dimensions from formal and practice-oriented standards. Experiments on ten open-source Python repositories show that CODEDOC produces higher-quality documentation than RepoAgent and a long-context baseline under standards-aligned evaluation, with relative improvements of 11.6%-17.0% and 21.4%-29.6%, respectively, while consuming roughly an order of magnitude fewer tokens per documentation entity than the long-context baseline. A human study confirms substantial alignment between LLM-based and human judgments (Spearman's rho = 0.72), and the relative findings hold across different judge LLMs. Code is available at https://github.com/ControllableModel/CodeDoc.

Tue 20 OctSoftware Engineering
The gist
Creating good documentation for software is hard because many tools just guess what to write without clear rules. The authors argue that documentation should follow strong quality standards and understand how code pieces depend on one another. They built a system called CODEDOC that uses those standards and code relationships to generate better explanations of functions and classes. Tests showed CODEDOC writes clearer docs faster and judges its work well compared to other tools. People also agreed that CODEDOC’s evaluations matched human opinions closely.
Open → 2610.27634v1

A verified stream protocol combines sync and async modules smoothly

Designing a Producer-driven Stream Protocol by Formal Refinement

Abstract: The coroutine has broadly diffused in the practice of concurrent programming in the form of generators and asynchronous functions as well as processes communicating through pipes. We wanted to use coroutines in Python to create single-threaded Unix-style pipelines. Unfortunately, available solutions in Python are cumbersome to use. The JavaScript push-stream protocol appeared to be a good alternative. However, its specification is incomplete and ambiguous. We have used TLA$^{+}$ and the TLC model checker to re-derive the protocol and obtain protocol-specific verification tools. In this paper, we present a formal specification of a push-stream protocol that 1) seamlessly combines synchronous and asynchronous modules, encapsulating the choice within each module; 2) provides flow control without using bounded buffers; 3) gracefully and unambiguously terminates; 4) does not require dynamic allocation of objects on the heap. In addition to completely describing expected behaviours, our specification improves on the original design by 1) allowing the input and output of intermediate pipeline modules to terminate independently and 2) explicitly reporting when a module is pending on the execution environment, to avoid incorrect resuming. We specify the protocol as a sequence of refinement steps and derive by equivalence a specification of what an abstract module may do. We then refine the latter into a module checker that can verify concrete module specifications for conformity. We have verified the key properties of all specifications and the validity of refinement steps with TLC. In supplemental material, we provide all TLA$^{+}$ specifications, show that the protocol is sufficiently expressive to implement a superset of all original JavaScript modules, as well as a performance comparison with Python alternatives and Unix pipes.

Sun 27 SeptProgramming Languages
The gist
Programming with pipelines that mix different ways of running tasks can be tricky in Python because current tools are hard to use. The authors studied an existing JavaScript stream protocol that uses a pushing approach and found it unclear. They carefully defined and checked a clearer version using formal math-based methods and software tools, improving how parts of the pipeline start and stop independently and handle waiting. Their work helps ensure that stream pipelines behave correctly and efficiently without needing complex memory use.
Open → 2609.33813v1

Graph guided method improves software environment setup success

Graph-Guided Repository Environment Construction

Abstract: Coding agents now increasingly rely on execution to validate their solutions, making the construction of reliable execution environments a critical enabling capability. However, repository environment construction is challenging because execution requirements are fragmented across repository artifacts and may only become apparent during execution. Existing agent-based approaches address this problem through iterative interaction, but information about the current construction state, including discovered requirements, satisfied and unresolved prerequisites, and their dependencies, can remain distributed across the interaction history. We present Graph2Env, an agent-based approach centered on DepGraph, a typed dependency graph that explicitly represents the environment requirements needed for repository execution, their dependency relations, and their states. Graph2Env uses DepGraph to guide environment construction and continuously refines it with execution feedback, while persisting successful repairs into a replayable construction procedure. The resulting artifacts are then applied in a fresh environment to verify that the constructed environment can be reproduced. We evaluate Graph2Env on a benchmark of 200 Python repositories drawn from RATBench and EnvBench, against a static dependency-inference baseline (pipreqs), three specialized environment-construction systems (Repo2Run, RAT, and SetupX), and two general-purpose coding agents (SWE-agent and Claude Code). Graph2Env achieves an 81.0% Environment Build Success Rate (EBSR) and a 59.3% Environment Setup Success Rate (ESSR), outperforming the strongest baseline by 9.5 and 9.0 percentage points, respectively.

Sun 27 SeptSoftware EngineeringArtificial Intelligence
The gist
Getting software project environments ready to run code properly is hard because requirements are spread across different files and may only show up when testing the code. The authors created Graph2Env, a tool that maps out all the needed parts and their connections in a clear graph to help build these environments step-by-step. By learning from errors during execution and keeping track of what works, Graph2Env builds setups that can be repeated reliably. When tested on many Python projects, it did better than existing methods at preparing working environments.
Open → 2609.33429v1

Python dependency failures cut by replaying known package setups

Escaping Python Dependency Hell: A Hybrid Replay-and-Repair Pipeline for Python Dependency Resolution

Abstract: Dependency conflicts in Python ecosystems arise from incompatible version constraints, missing packages, and undocumented compatibility relationships, causing many real-world code snippets to fail at execution. This paper presents PLLM+, a hybrid dependency-repair pipeline evaluated on the HG2.9K benchmark of 2,891 dependency-failing snippets. PLLM+ prioritizes inexpensive deterministic steps before invoking LLM-based repair: static AST-based interpreter inference, replay of historically successful dependency configurations from the competition-provided solutions database, and live PyPI validation of candidate package versions. When these steps do not resolve a case, the system falls back to a structured LLM-based repair loop with typed error classification and Proposer/Critic agents. On HG2.9K, PLLM+ solves 1,500 out of 2,891 snippets, compared with 1,169 solved by the PLLM baseline. It also reduces average runtime from 368.7 to 71.8 seconds per snippet. Most successful fixes come from replaying known configurations: 1,495 of the 1,500 successful fixes are produced by the solutions database, while the LLM fallback accounts for 5 additional fixes. These results suggest that, in this benchmark setting, deterministic reuse of previously validated dependency configurations is a simple and effective strategy, with LLM-based repair serving as a secondary fallback for cases not covered by prior solutions.

Tue 22 SeptArtificial IntelligenceMultiagent SystemsSoftware Engineering
The gist
When Python programs fail because their required packages don't work together, it can be tricky to fix the problem. The authors created a system called PLLM+ that first tries easy methods like reusing past package setups that worked before and checking package versions carefully. Only if those don't work does it try a more complex process using AI language models to suggest fixes. This approach solved more than half of the test cases and was much faster than just using the AI model alone. Most fixes came from reusing old working package setups, showing that simple reuse works well before trying AI.
Open → 2609.26952v1

Python projects face common issues running on different operating systems

An Empirical Analysis of Cross-OS Portability Issues in Python Projects

Abstract: While Python is designed as a cross-platform language, real-world applications encounter portability failures when deployed across different operating systems. We present the first large-scale empirical study of cross-OS portability issues in Python, analyzing 2,042 open-source repositories using two complementary approaches: systematic cross-OS test reexecution and manual analysis of GitHub issues. Our cross-platform testing of 500 projects reveals that 11.2% exhibit OS-dependent test failures. Through systematic analysis of 240 GitHub issues, we confirm 102 genuine portability problems spanning 95 additional projects. We develop a comprehensive taxonomy identifying 7 primary failure categories - with file/directory operations, process management, and library dependencies being most prevalent - along with 24 distinct sub-categories, 15 diagnostic signatures, and 4 systematic repair patterns. Our evaluation reveals that existing static analysis tools provide minimal support for portability detection, while large language models achieve 40-79% accuracy in identifying issues and 50-77% success in generating fixes when provided with structured guidance. Through 33 contributed pull requests, we demonstrate practical applicability and developer acceptance (17 merged, zero rejected) of our findings. This work establishes the first comprehensive baseline for understanding and addressing cross-OS portability issues in Python, providing actionable insights for developers, tool designers, and the broader research community.

Tue 22 SeptSoftware Engineering
The gist
Python is meant to work the same on any computer system, but many real programs still run into problems when moved between different operating systems like Windows and Linux. The authors studied over two thousand projects and found about 11% had test failures due to OS differences. They categorized the main types of problems and tested how well current tools and AI can detect and fix these issues. Their findings include useful patterns for developers and evidence that some fixes are accepted by the open-source community.
Open → 2609.25531v1

Machine learning finds swapped arguments in Python code without full context

Detecting Argument-Swap Bugs Using Context-Enhanced Code Representations

Abstract: Names of source code elements convey rich semantic information and have been widely used in software engineering tasks such as bug detection, code completion, type prediction, and code classification. Prior studies exploit lexical similarity between method arguments and formal parameter names to detect bugs caused by incorrectly ordered arguments, typically relying on establishing mappings between method calls and their corresponding definitions. However, such mappings are often difficult to obtain in dynamically typed languages like Python. In this paper, we present BugProbe, a learning-based approach for detecting incorrectly ordered arguments in Python method calls that does not require call-to-definition mappings. Our approach leverages multiple sources of contextual information, including local context and argument usage context, and combines name-based similarity with machine learning to construct expressive representations of method arguments. We collect a new dataset of 132,739 Python source files from the top-1,000 starred GitHub repositories, yielding 3,371,244 synthetic training examples, and contribute a curated benchmark of 55 real-world argument-swap bugs manually verified from commit histories. We evaluate our approach on this dataset and show that it achieves high accuracy and consistently outperforms a state-of-the-art baseline across standard evaluation metrics. These results demonstrate that effective detection of argument-ordering bugs is possible without relying on explicit call-to-definition resolution, making the approach well suited for dynamically typed language settings.

Tue 15 SeptSoftware Engineering
The gist
Sometimes programmers accidentally swap the order of inputs when calling functions, which can cause bugs. The authors created a method called BugProbe that uses machine learning to spot these swapped arguments in Python code, even when it's hard to find out which function is being called. They trained BugProbe with lots of example code and tested it with real bugs found in popular projects, showing it works better than earlier methods. This approach helps find bugs in dynamically typed languages like Python, where traditional methods struggle.
Open → 2609.17844v1