[Python-ideas] Message passing syntax for objects

Mark Janssen dreamingforward at gmail.com
Mon Mar 18 19:29:00 CET 2013


> You're dreaming of a utopia where computers just read our minds and
> know what we're thinking. So what if I can pass 42 into an object.
> What do I intend to happen with that 42? Do I want to add the element
> to a list? Access the 42nd element? Delete the 42nd element? Let the
> object pick a behavior at random?

Huh?, No the programmer has to think of how data interacts with
his/her objects.  It's just that *now* the language is wise enough to
teach them to think about it.

> So
> what's the benefit of that over having the object implement the
> __call__ method?

You bring up an interesting subject.  I think you could get rid of the
__call__ special method on objects.  I think this is the wrong view
into the object universe or *data ecosystem*.

> Also, why would we re-use the bit shift operators for message passing?
> Just because C++ decided to overload the existing operators to mean
> reading into and writing out of a stream doesn't mean it's a good
> idea.

You're right, perhaps there's a better set of symbols that suggest
"moving data".

Mark



More information about the Python-list mailing list