Is this unpythonic?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri May 8 11:07:05 EDT 2015


On Fri, 8 May 2015 08:53 pm, Frank Millman wrote:
>> Does z have to be a list? Could you use an empty tuple instead?
>>>> def x(y, z=()): ...
>>>> That was Chris' suggestion as well (thanks Chris).
>> The idea appealed to me, but then I found a situation where I pass in a
> dictionary instead of a list, so that would not work.

Why wouldn't it work? If it worked with an empty list, it will probably work
with an empty tuple instead.
-- 
Steven


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /