Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #17937 > unrolled thread
| Started by | Tim Chase <python.list@tim.thechases.com> |
|---|---|
| First post | 2011-12-25 19:14 -0600 |
| Last post | 2011-12-25 19:14 -0600 |
| 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: How safe is this way of getting a default that allows None? Tim Chase <python.list@tim.thechases.com> - 2011-12-25 19:14 -0600
| From | Tim Chase <python.list@tim.thechases.com> |
|---|---|
| Date | 2011-12-25 19:14 -0600 |
| Subject | Re: How safe is this way of getting a default that allows None? |
| Message-ID | <mailman.4087.1324862079.27778.python-list@python.org> |
On 12/25/11 18:49, Dan Stromberg wrote: > How safe is this? I like the idea. > > UNSPECIFIED = object() > > def fn(x, y=UNSPECIFIED): > if y is UNSPECIFIED: > print x, 'default' > else: > print x, y safe? It's idiomatic :) -tkc
Back to top | Article view | comp.lang.python
csiph-web