On Dec 31, 2008, at 1:41 AM, anatoly techtonik wrote:

>
> On Wed, Dec 31, 2008 at 12:10 AM, Noah Kantrowitz  
> <[email protected]> wrote:
>>
>>>> The __init__ of the metaclass isn't related to the __init__ of the
>>>> class. Its purely a stylistic decision in this case, though __new__
>>>> does allow a small more flexibility that __init__ in that you can
>>>> return something other than an instance of the class.
>>>
>>> Right. When I first looked at __new__ definition in metaclass I
>>> expected to find some magic which will make this method return
>>> something else than instance of the class, but haven't found  
>>> anything.
>>
>>
>> Am I missing some pressing reason to change it though?
>>
>
> Would the reason "reduce time to get new/plugin developers acquaint
> with codebase" be enough? It took about three days to dwell into Trac
> metaclass details. It is hard to estimate the exact amount of time
> this commit could save, but I would say about 2 hours, because the
> official documentation is very poor in the aspect of __new__ and
> __init__ differences.

ComponentMeta is an internal implementation detail and not something  
plugin authors ever see or care about. The real way to do all this is  
with a class decorator, but it will be years before we can use those.  
If new developers are really struggling with _anything_ in the  
codebase for 2 hours I would highly advise them to hop on #trac and  
ask (or on the ML, but I prefer asking those kind of questions in IRC).

--Noah

PS: I am aware that I sometimes use ComponentMeta in my plugins, do as  
I say not as I do ;-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to