Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #92041 > unrolled thread
| Started by | Peter Otten <__peter__@web.de> |
|---|---|
| First post | 2015-06-04 11:28 +0200 |
| Last post | 2015-06-04 11:28 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Argument Presence Checking via Identity or Boolean Operation? Peter Otten <__peter__@web.de> - 2015-06-04 11:28 +0200
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2015-06-04 11:28 +0200 |
| Subject | Re: Argument Presence Checking via Identity or Boolean Operation? |
| Message-ID | <mailman.154.1433410181.13271.python-list@python.org> |
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.
Back to top | Article view | comp.lang.python
csiph-web