Georg Brandl wrote:
>> But that can only work if you are the author of f. Take the
>> following code:
>>>> def myrepeat(obj, times = xxx):
>> return itertools.repeat(obj, times)
>>>> What value do I have to substitue for xxx, so that myrepeat
>> will have the exact same function as itertools.repeat?
>> There's no possible value. You'll have to write this like
>> def myrepeat(obj, times=None):
> if times is None:
> return itertools.repeat(obj)
> else:
> return itertools.repeat(obj, times)
or:
def myrepeat(*args):
return itertools.repeat(*args)
</F>