Hi --

On Fri, 14 Jan 2005, Ilmari Heikkinen wrote:

> Hi,
>
> On 14.1.2005, at 15:31, David A. Black wrote:
>>> def silly_example(ostr, ocount, str=ostr.to_str, count=ocount.to_int)
>> 
>> Yes except that then someone could call it like this:
>> 
>>   silly_example("hi", 1, "hello", 2)
>> 
>> and clobber the conversions you were doing.
>
> Could argue that it's wanted behavior.. "if you want to hack this without 
> hacking to_str and to_int, replace the defaulted args"
>
> Since this IMHO is pretty much an auto-documented wish for the caller to 
> supply objects that act like ducks.

You asked whether you could already do what Robert was proposing, by
using the construct you've suggested -- to which the answer is no,
since he his proposal didn't include that kind of overriding :-)


David

-- 
David A. Black
dblack / wobblini.net