default value in __init__

Aaron Brady castironpi at gmail.com
Sun Oct 19 03:16:55 EDT 2008


Steven D'Aprano wrote:

> On Sun, 19 Oct 2008 02:52:52 +0000, Aaron Brady wrote:
>
>> Steven D'Aprano wrote:
>> 
>>> On Sat, 18 Oct 2008 09:17:28 +1300, Lawrence D'Oliveiro wrote:
>>>
>>>> In message
>>>> <da493481-7183-423d-bf12-56c1ca8a7f04 at k30g2000hse.googlegroups.com>,
>>>> Aaron "Castironpi" Brady wrote:
>>>> 
>>>>> The purpose of a parameter is something that the caller can supply,
>>>>> but doesn't have to.  It is not for internal-use-only items.
>>>> 
>>>> Exactly!
>>>
>>> Says who?
>>>
>>> Using arguments for internal-use-only is a perfectly acceptable example
>>> of practicality beating purity.
>> 
>> That's a stretch.
>
>
> It's a standard Python idiom used by the standard library.
>

It's a compromise solution, where the other compromises are about as
good.

...Except for the confused newbies.  But why should they pick this
feature to ignore the documentation for?  It trades off intuitiveness
for convenience.






More information about the Python-list mailing list