Thanks Sven. That's just what I was looking for.
For anyone interested, here is the message with Guido's gut-feeling back in
2004, and the in the subsequent few posts are arguments one way or the other:
http://mail.python.org/pipermail/python-dev/2004-August/046711.html
In summary, there is a d
pand this further, for instance your decorator could expose the
> original function so you don't have to keep on re-running the decorator.
>
> decoratedfoo = mydecorator(foo) # create decorated function
> decoratedfoo(1, 2) # run decorated function
> decoratedfoo.or
; Finally, if you're trying to implement singleton like behaviour. (a registry
> etc..) then using your example of binding an instance of MyDecorator() to a
> module-level name is sensible.
>
> MY_REGISTRY = MyDecorator()
>
> @MY_REGISTRY.decoate_this()
> def wrapped():
>
> ___
> python-uk mailing list
> python-uk@python.org
> http://mail.python.org/mailman/listinfo/python-uk
Simon Yarde
07525 063 134
simonya...@me.com
___
python-uk mailing list
python-uk@python.org
http://mail.python.org/mailman/listinfo/python-uk
Hi All
I've not posted to this list before. Hello!
I have a question about decorators and have failed to devise a search that has
thrown up any history of discussion on this particular matter.
Does the following seem like something that 'should' work? Or is anyone aware
of a source of document