Roman Susi schrieb:
Chris Rebert wrote:
Jim Jewett wrote:
On 1/28/07, Chris Rebert cvrebert@gmail.com wrote:
/skip/
def foo(bar=new baz): #code
This would be less bad.
That said, I fear many new programmers would fail to understand when they needed new and when they didn't, so that in practice, it would be just optional random noise.
This is part of the reason I'm trying to avoid adding new syntax. However, I assert that at least 'new' is clearer than the' x=None; if x
But if you are concerned with the current None, there could be some other, new False value serving the same need, like:
def foo(x, y, z, bar=Missing, qux=Missing): if baz is Missing: baz = [] #code
or even:
def foo(x, y, z, bar=, qux=): if baz is Missing: baz = [] #code
why not even
def foo(x, y, z, bar=..., qux=...): if bar is Ellipsis: # foo
;)
Georg