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


Groups > comp.lang.python > #42042

RE: Decorator help

From "Joseph L. Casale" <jcasale@activenetwerx.com>
Subject RE: Decorator help
Date 2013-03-27 20:41 +0000
References <CAEk9e3qgtZPXRjtD8cQaGNS_vTJRFrqRKnc3T438wWwBhC0Z-g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3828.1364416912.2939.python-list@python.org> (permalink)

Show all headers | View raw


> So  decorators will never take instance variables as arguments (nor should they, since no instance
> can possibly exist when they execute).


Right, I never thought of it that way, my only use of them has been trivial, in non class scenarios so far.


> Bear in mind, a decorator should take a callable as an argument (and any number of 'static' parameters
> you want to assign  it), and return another callable.


Got it, and thanks for the detail as well!
jlc

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


Thread

RE: Decorator help "Joseph L. Casale" <jcasale@activenetwerx.com> - 2013-03-27 20:41 +0000

csiph-web