Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72889

Decorating one method of a class C with another method of class C?

Date 2014-06-06 17:14 -0700
Subject Decorating one method of a class C with another method of class C?
From Dan Stromberg <drsalists@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.10836.1402100103.18130.python-list@python.org> (permalink)

Show all headers | View raw


Is there a way of decorating method1 of class C using method2 of class C?

It seems like there's a chicken-and-the-egg problem; the class doesn't
seem to know what "self" is until later in execution so there's
apparently no way to specify @self.method2 when def'ing method1.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Decorating one method of a class C with another method of class C? Dan Stromberg <drsalists@gmail.com> - 2014-06-06 17:14 -0700
  Re: Decorating one method of a class C with another method of class C? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-06-07 04:40 +0000

csiph-web