Prothon, metaclasses, Zope [Was: A 'Python like' language]

Mark Hahn mark at prothon.org
Wed Mar 31 19:46:55 EST 2004


Greg: Just a quick note to let you know that I do intend to reply to this
but haven't had the time.

Greg Ewing (using news.cis.dfn.de) wrote:
> Mark Hahn wrote:
>>> But presumably he wants the check done only once, when a subclass is
>>> defined, *not* every time said subclass is instantiated.
>>
>> You can have a different __init__ for an object and it's prototpe.So
>> the Prothon equivalent of a subclass can easily have different
>> __init__ behaviour than it's child (what you call instance).
>
> Can you post some code illustrating how you would do this
> in Prothon? I still can't see how, at the point where you
> do
>
>    X = Base()
>
> anything can tell whether you're intending to use X as
> an instance of Base or whether you're going to go on to
> say
>
>    with X:
>      def ...
>
> and use X as a prototype which inherits behaviour from
> Base. In both cases, Base.__init__ is going to get invoked
> before you have a chance to define any other __init__ that
> might override it.





More information about the Python-list mailing list