[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] @
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] @
- From: "Jake b" <ninmonkeys@xxxxxxxxx>
- Date: Wed, 31 Dec 2008 18:18:26 -0600
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 31 Dec 2008 19:18:31 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=v7ggtIg16i3hqY7fcZs67ZpNwZAkThyJPI+AaZ7IEEw=; b=KlzRZ4KGW9L6y0vPWVsHYrd2KVGgNRgNtcQl1FVg1IYt+dJzdEcJJSCOhlV41UcWPY hfDAYjPTbbClyrcIjrUWPuoAhF3XXREFGoAk8sZF7CsOJhrbuHmV0CgzYwZA9j0sTghj K5CI2Zzb67TcNp7q2PXnmt17kA36o5++fVQbI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Zebcphk/12ovWCbuHoZPSrbUhojx19KVwodJ46O/bmqVfTcsU13pWk+mi9YlmnoSnx aShdyKH6r9WJVBxJ/EfoDbQ9uJiLjheCT/n6eseD8OoFlg9H4paGoAI03cEeq4cTY1Ea BTbI7wfF6tKjDxy0TYL0gPZl3PCI7W5pzpgiI=
- In-reply-to: <495BECA1.2090707@xxxxxxxxx>
- References: <321526.57082.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <495BECA1.2090707@xxxxxxxxx>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
If it doesn't execute on function call, I don't get what the use is? I
thought if I did this, it would print out "I am decorator" ( but it
only does it on function declaration )
def dec(f):
print "I am decorator!", f
return f
@dec
def fn(x): return x
( And if it doesn't, then the logThisMethodCall() will not be logging
every time it is called, just once on declaration ?: )
On Wed, Dec 31, 2008 at 4:05 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> An instance of function fn is created, then function decorator is called with that instance as its only argument. > decorator then returns the function instance, which is assigned to identifier fn. So a decorator is called when a > function declaration is executed, not later when the function is called.
>--
Jake