FEEDBACK WANTED: Type/class unification

Hamish Lawson hamish_lawson at yahoo.co.uk
Thu Aug 23 04:17:28 EDT 2001


Terry Reedy wrote:

> I presume you are proposing a default "def __call__(self): return
> self" for all objects.

Yes, that's what I was suggesting.

> Would it be useful? or would it encourage bad programming?, that is
> the question.

I think it's useful being able to hide whether a property of an object
should be obtained via simple attribute access or via a method call.
The PEP addresses this with its proposal for getters/setters, so that
attribute access can trigger a method call. I was exploring going the
other way - having it so that you could always employ a method call.
But there may well be problems with that approach.

Just-thinking-out-loud-ly,

Hamish Lawson



More information about the Python-list mailing list