Implement logic on object.attribute and object.attribute()

Devin Jeanpierre jeanpierreda at gmail.com
Sun Nov 24 08:04:16 EST 2013


On Sun, Nov 24, 2013 at 4:52 AM, Marc Aymerich <glicerinu at gmail.com> 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



More information about the Python-list mailing list