[portland] class decorators useful?

kirby urner kirby.urner at gmail.com
Fri Apr 17 02:38:38 CEST 2009

On Thu, Apr 16, 2009 at 5:28 PM, Adam Lowry <adam at therobots.org> wrote:
> On Apr 15, 2009, at 5:25 PM, kirby urner wrote:

<< SNIP >>

> Registration was the only case I could think of that worked well in my mind.
> In the past I've got the augmentation route and felt that it made the code
> less readable and less understandable; I should have composed a helper
> object. In this example that method or a straight subclass (or even mixin)
> would be easier to read in my opinion.

Thank you.

I appreciated your outburst at the meeting, take your warnings about
reduced readability seriously (your Python scholarship has always
impressed me).

We went down a long road on edu-sig awhile back, using function
decorators to turn a function into its mathematical derivative.  I'd
even showcased this technique in a talk (GIS meeting in 2005, similar
to the one next week).

Later in the thread, in which Guido participated, we reached a
consensus that this was hurting more than helping, more a "false
trail" than a great way to go. **

So yeah, I'm happy to keep a retreat route and think your suggestion
to hunt class decorators in the wild is a good one.


> But for pure library code like an ORM, where the user is not intended to
> need to dive into the guts, they can be useful.
> Perhaps we can find some code in the wild that make good use of them?
> Adam
> _______________________________________________
> Portland mailing list
> Portland at python.org
> http://mail.python.org/mailman/listinfo/portland

** there's a running game expats play, involving "hares" laying a
trail ahead of time, others following, with a number of dead ends
deliberately included, just to confuse, make it more like a maze:
http://www.gthhh.com/  (my dad was super into it, in both Bangladesh
and Lesotho, mom too some, and me when I'd visit).

More information about the Portland mailing list