"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Has anyone else felt a desire for a 'nochange' value

No.

> resembling the 'Z'-state of a electronic tri-state output?

Not familiar with that.

>
> var1 = 17
> var1 = func1()   # func1() returns 'nochange' this time
> print var1       # prints 17
>
> It would be equivalent to:
>
> var1 = 17
> var2, bool1 = func1()
> if bool1:
>   var1 = var2
> print var1       # prints 17

Simpler is

var1 = 17
var2 = func1()
if var2 is not 'nochange': var1 = var2

or
var1 = func2(var1)
with func2 conditionally returning the input instead of 'nochange'.
The default return, of course, could be something other than var1.

Conclusion: you can easily do what you want with Python as it is.

Terry J. Reedy



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

Reply via email to