Prothon Prototypes vs Python Classes

John Roth newsgroups at jhrothjr.com
Sun Mar 28 20:31:38 EST 2004


"John Roth" <newsgroups at jhrothjr.com> wrote in message
news:106eo695a9t8820 at news.supernews.com...
> "Harald Massa" <cpl.19.ghum at spamgourmet.com> wrote in message
> news:Xns94BBF152E6BBcpl19ghumspamgourmet at 62.153.159.134...
> > Mark,
> >
> > I see most discussion about Prothon is concerning prototypes.
> >
> > Can you explain to me in easy words, why it is NOT possible to integrate
> > prototypes into Python to stand "side by side" with classes?
> >
> > I never had a problem to "add an attribute" to an existing object; I
> really
> > can't see why it should be more than some small hacks to allow "adding a
> > function to an existing object".
>
> As you note, you can do that with a simple assignment,
> and it will work. The two problems are:
>
> 1. The clone operation
>
> 2. Syntax sugar to make it all nice and palatable.
>
> I suspect that a usable clone() operation is less
> than 10 lines. The syntax sugar, on the other hand,
> will IMNSHO, take forever to get agreement.
>
> John Roth

Sigh. I'm replying to my own post. After I posted this, I
remembered that something needs to be done to set up an
inheritance chain among instances. That requires a custom
__getattribute__() magic method, which will not be all that
easy to write.

John Roth
> >
> >
> > Harald
>
>





More information about the Python-list mailing list