Re: Param decorator - can you suggest improvements

2013-01-18 Thread Dan Sommers
On Fri, 18 Jan 2013 09:10:34 +, Steven D'Aprano wrote: > On Fri, 18 Jan 2013 03:38:08 +, Dan Sommers wrote: >> This, or something like this, is very old: >> >> sentinel = object() >> class Magic: >> def __init__(self, value): >> self.value = value >> def __call__(self, va

Re: Param decorator - can you suggest improvements

2013-01-18 Thread Steven D'Aprano
On Fri, 18 Jan 2013 03:38:08 +, Dan Sommers wrote: > On Thu, 17 Jan 2013 15:21:08 +, Steven D'Aprano wrote: > >> On Thu, 17 Jan 2013 06:35:29 -0800, Mark Carter wrote: >> >>> I thought it would be interesting to try to implement Scheme SRFI 39 >>> (Parameter objects) in Python. >>> >>>

Re: Param decorator - can you suggest improvements

2013-01-17 Thread Dan Sommers
On Thu, 17 Jan 2013 15:21:08 +, Steven D'Aprano wrote: > On Thu, 17 Jan 2013 06:35:29 -0800, Mark Carter wrote: > >> I thought it would be interesting to try to implement Scheme SRFI 39 >> (Parameter objects) in Python. >> >> The idea is that you define a function that returns a default valu

Re: Param decorator - can you suggest improvements

2013-01-17 Thread Steven D'Aprano
On Thu, 17 Jan 2013 06:35:29 -0800, Mark Carter wrote: > I thought it would be interesting to try to implement Scheme SRFI 39 > (Parameter objects) in Python. > > The idea is that you define a function that returns a default value. If > you call that function with no arguments, it returns the cur