[Python-ideas] parameter omit

Chris Rebert cvrebert at gmail.com
Sun May 13 00:43:36 CEST 2007


<snip>
> ?  How common are non-None default values?
</snip>

Quoting myself from 
http://mail.python.org/pipermail/python-3000/2007-February/005704.html 
([Python-3000] pre-PEP: Default Argument Expressions), when I generated 
statistics related to this subject:

 > A survey of the standard library for Python v2.5, produced via a
 > script [7], gave the following statistics for the standard library
 > (608 files, test suites were excluded):
 >
 >   total number of non-None immutable default arguments: 1585 (41.5%)
 >   total number of mutable default arguments: 186 (4.9%)
 >   total number of default arguments with a value of None: 1813 (47.4%)
 >   total number of default arguments with unknown mutability: 238 (6.2%)
 >   total number of comparisons to None: 940

So, I'd say that they're pretty frequent, with at least 41.5% of all std 
lib default values being non-None.

- Chris Rebert



More information about the Python-ideas mailing list