Coding Pitfalls: Demystifying the Potential API Compatibility Risk of Variadic Parameters in Python

In Python development, developers often use variadic parameters, i.e., *args and **kwargs, to ensure backward compatibility of APIs after parameter changes or enhancements. Variadic parameters enable APIs to accept an arbitrary number of arguments. However, our preliminary investigation reveals that when an API with variadic parameters internally passes these parameters to other APIs that do not support variadic parameters, it may introduce potential compatibility issues, i.e., variadic parameter pitfalls (VPPs). In this work, we explore the prevalence and impact of VPPs by conducting an empirical study on 33 popular Python third-party libraries using a prototype tool, i.e., VPPDETECTOR. We provide recommendations to mitigate VPPs based on our findings.

Authors

Institutions

Publication Details

Published
2024-10-28
DOI
https://doi.org/10.1109/issrew63542.2024.00057
Citations
1
Primary Topic
Computational Physics and Python Applications
Type
article
Field-Weighted Citation Impact
0.35

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Coding Pitfalls: Demystifying the Potential API Compatibility Risk of Variadic Parameters in Python

Guanping Xiao, Shuai Zhang, Guanglin He
1 citations
Computational Physics and Python Applications
0.35
article

Coding Pitfalls: Demystifying the Potential API Compatibility Risk of Variadic Parameters in Python

Guanping Xiao, Shuai Zhang, Guanglin He
article en
1 citations

Abstract

In Python development, developers often use variadic parameters, i.e., *args and **kwargs, to ensure backward compatibility of APIs after parameter changes or enhancements. Variadic parameters enable APIs to accept an arbitrary number of arguments. However, our preliminary investigation reveals that when an API with variadic parameters internally passes these parameters to other APIs that do not support variadic parameters, it may introduce potential compatibility issues, i.e., variadic parameter pitfalls (VPPs). In this work, we explore the prevalence and impact of VPPs by conducting an empirical study on 33 popular Python third-party libraries using a prototype tool, i.e., VPPDETECTOR. We provide recommendations to mitigate VPPs based on our findings.

Nanjing University of Aeronautics and Astronautics (CN)
National Natural Science Foundation of China, Natural Science Foundation of Jiangsu Province
Openalex Percentile: Top 31%
Computational Physics and Python Applications
0.35
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.