Frank Millman wrote:

> I have a slight variation in that I want to keep a reference to the
> argument -
> 
> def __init__(self, arg=None):
>     self.arg = arg or []
> 
> Based on your comment, I have changed it to -
> 
> def __init__(self, arg=None):
>     self.arg = [] if arg is None else arg
> 
> Does this pass your 'stop and consider' test?

Yes, that avoids the problem of the original code.


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to