Decorated class question

Devin Jeanpierre jeanpierreda at gmail.com
Mon Jan 16 11:18:51 EST 2012


On Mon, Jan 16, 2012 at 10:10 AM, deathweaselx86 <deathweasel at gmail.com> wrote:
> If I decorate a class, then subclass it, does my subclass feature
> whatever the decorator did to my superclass?

Yes. The following two things are completely equivalent:

@foo
class Bar(...):
    ...

# and

class Bar(...)
    ...
# immediately afterward
Bar = foo(Bar)

-- Devin



More information about the Python-list mailing list