Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.022 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'attribute': 0.07; 'http': 0.09; 'subject:()': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '24,': 0.16; 'behave': 0.16; 'executed.': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'this:': 0.26; 'post': 0.26; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'marc': 0.31; 'objects': 0.35; 'received:google.com': 0.35; 'accessing': 0.36; 'hi,': 0.36; 'nov': 0.38; 'first': 0.61; 'to:addr:gmail.com': 0.65; 'request.': 0.70; 'subject:skip:o 10': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=gUyiodoAnrByuPvc49iH+z+XgfMQBEQvFuPdo7WwL48=; b=nvlGnIJK4aAmXT/2aNh+4AOjmGBcYc41zYCWME7e4XoGx1Yzf7FrViQTF0N2bQ1GwQ KHdWoKndC1tfIQudWU9voinT+fMce3aGDjVqHK6o1zgaUabMysCnByti7ePhUq3i/e2w VEuzLLSy0ZX+Fxu523m23levF3B5l+zdRQrw0l1I4MCiWwAHEfQdkLSTPer12wW6mIjk BZs8OmBdM/hET0W/ck5z4udK045kjICiYtO/RPvGEGeQUqF+fmMrnQ1rRjXspEfNWxfj 3sK2AGXrrXwF1UjR4cgbDvodU3uO0zP/LxNxb8tyFMnZKSE6/2JaELPTm9VlrUdc1hHh 1apw== X-Received: by 10.49.99.98 with SMTP id ep2mr38084318qeb.9.1385298296584; Sun, 24 Nov 2013 05:04:56 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Devin Jeanpierre Date: Sun, 24 Nov 2013 05:04:16 -0800 Subject: Re: Implement logic on object.attribute and object.attribute() To: Marc Aymerich Content-Type: text/plain; charset=UTF-8 Cc: "comp.lang.python" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1385298299 news.xs4all.nl 15919 [2001:888:2000:d::a6]:49059 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60364 On Sun, Nov 24, 2013 at 4:52 AM, Marc Aymerich wrote: > Hi, > I'm playing with python internals to make objects behave like this: > > if I access to "object.attribute" I want to return the result of an > HTTP GET request. However if i call "object.attribute()" I want an > HTTP POST request to be executed. Uh oh. What you want is impossible. You cannot call an attribute without first accessing it. :( -- Devin