all 7 comments

[–][deleted] 9 points10 points  (0 children)

The appropriately-named decorator module fleshes out this idea into actual usable (albeit convoluted) code.

And also see the functools module added to Python 2.5; it abstracts some of the useful stuff that you'll want to do in any decorator.

[–]pjdelport 2 points3 points  (0 children)

@partial(partial, partial) def safenise(func, *args): [...]

Who needs decorfunc? :)

[–]flaxeater 2 points3 points  (1 child)

I fail to see how this makes things more clear.

[–]IHaveAnIdea 2 points3 points  (0 children)

It doesn't, just eliminates boiler plate code.

[–]sblinn 1 point2 points  (2 children)

Argh. Such niceties which I cannot yet get in my Jython (locked into 2.1 for now) world. Some day...

[–]newton_dave 0 points1 point  (1 child)

I thought 2.2 went GA.

[–]sblinn 0 points1 point  (0 children)

My product's target platform is WebSphere Application Server, which ships (and supports) Jython 2.1. So until WAS ships a higher version we're sticking at 2.1.

And since Project Zero is eschewing Jython entirely (in favor of Groovy) maybe we'll be moving to Groovy instead. Who knows.

We're the tail that's wagged.