Vitja Makarov, 07.11.2010 09:41:
> 2010/11/7 Stefan Behnel:
>> Vitja Makarov, 06.11.2010 21:37:
>>> I'm now trying to implement this:
>>>
>>> Is it correct:
>>>
>>> If parser detect use of kwargs in class definition it creates 
>>> Py3ClassDefNode
>>>
>>> I add this classes:
>>> Nodes.Py3ClassDefNode   - ClassDefNode replacement for python3 style classes
>>> ExprNodes.Py3ClassNode - ClassNode replacement for python3 style classes
>>>
>>> ExprNdoes.Py3MetaclassNode - contains metaclass
>>>      Holds value returned by __Pyx_Py3MetaclassGet(bases, mkw)
>>>
>>> ExprNodes.Py3NamespaceNode - contains namespace object
>>>      Value returned by __Pyx_Py3MetaclassPrepare(metaclass, base, name,
>>> mkw), that calls __prepare__ if any.
>>
>> Why do you think these new classes are necessary?
>>
>
> I think this objects are required to represent metaclass and namespace.
> If we want real support for __prepare__ (simple version is attached in trac)

Let me take a closer look at your current patch, I'll try to find some time 
tomorrow.


> 1. extract metaclass from bases and keywordargs
> 2. create namespace by calling metaclass __preapre__
> 3. fill namespace with class body
> 4. create class
>
> I don't want to reuse ClassDefNode as it differs too much. To many if/else.
> So Py3ClassNode should hold metaclass and namespace objects, I add
> Py3MetaclassNode and Py3NamespaceNode.
>
> Can I use PyTempNode for metaclass and namespace?

Temporary variables are handled mostly automatically in Cython. I'll try to 
figure out what's needed here.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to