Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78678 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18466 invoked from network); 4 Nov 2014 20:11:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 20:11:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=sean@seancoates.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sean@seancoates.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain seancoates.com from 208.72.237.35 cause and error) X-PHP-List-Original-Sender: sean@seancoates.com X-Host-Fingerprint: 208.72.237.35 pb-smtp1.int.icgroup.com Received: from [208.72.237.35] ([208.72.237.35:60872] helo=sasl.smtp.pobox.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/C2-02095-ED239545 for ; Tue, 04 Nov 2014 15:11:11 -0500 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 9C48E1B3E4; Tue, 4 Nov 2014 15:11:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= n9lI44lvBhKJ8lWAhIZ3lBnNjac=; b=eyXK5tca4oxBb0SZWPvF112JxU00omXf sIwCYIT99i89K0icdo8qovS5SCB4cNARgccXQwChNh5UVYZSdhYY2Hcub2I2Y6xk 6fQF06gikpM5qX3fk0BdRWyoazdG34NRHE4h+fhxn204xQzh9OsM3Z3GoMMdxviE Wfvu4dhtPTM= Received: from pb-smtp1.int.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 901B31B3E1; Tue, 4 Nov 2014 15:11:07 -0500 (EST) Received: from [192.168.145.100] (unknown [96.22.16.115]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id F17DE1B3DE; Tue, 4 Nov 2014 15:11:06 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) In-Reply-To: Date: Tue, 4 Nov 2014 15:11:05 -0500 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <6EA64B87-4762-4FC2-A9EF-E8B07C9BB14F@seancoates.com> References: <5457AF2F.90808@php.net> <5457BDB7.8070701@garfieldtech.com> <54589A8D.3020607@sugarcrm.com> <1C3F4FA3-ABD5-4F6F-A898-F63AC1C723D5@ajf.me> <54591A76.8070302@sugarcrm.com> To: Stas Malyshev X-Mailer: Apple Mail (2.1990.1) X-Pobox-Relay-ID: B6042586-645E-11E4-8307-692F9F42C9D4-96568589!pb-smtp1.pobox.com Subject: Re: [PHP-DEV] Annotation PHP 7 From: sean@seancoates.com (Sean Coates) >> In Python, decorators are very >> powerful for modifying function behavior (i.e., attaching pre/post >> conditions to functions or doing some things phpunit does is really >> easy) but it is too much for just attaching data. FWIW (and I apologize if this is just adding to the noise), one of the = most powerful things about decorators in Python is that the decorator = can do different things in different contexts. For example, in the web-app context `@app.task` might cause a = function=E2=80=99s execution be deferred, and return quickly so the = actual work can be carried out by another process. In a worker context, `@app.task` could be used to define the work that = should actually be carried out by the current worker. Reference for those interested in a practical example: = http://celery.readthedocs.org/en/latest/userguide/tasks.html S