Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> How do you decide whether handle.foo should be treated as an attribute or
> an operation?

That's exactly what I'm trying to figure out.  In the legacy system I'm 
trying to emulate, the interpreter knows the from syntax (i.e. whether 
handle.foo is followed by an open paren or not).  I'm looking for some way 
I can emulate that behavior in Python.
> 
> If your object has an attribute foo, then what should you do when somebody
> calls handle.foo()? That is, they treat an attribute as if it were an
> operation? And vice versa.

That's easy.  In such a case, the database will generate an error, which I 
can then pass on to the user, probably by raising some subclass of 
TypeError.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to