exposing extension class attributes

Simon Burton <[email protected]>
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
I am considering using some kind of name convention to distinguish between
extension class access at the python and at the c level:

cdef class Foo:

    cdef int _foo

    def __init__(self, int foo):
        self._foo = foo

    property foo:
        def __get__(self):
            return self._foo


Ie. the c attribute has an underscore in front of it, and
from python the attribute is without underscore.

As this is likely to drive me moderately crazy (keeping track
of underscores) I am wondering how other people handle this issue ?

I guess I am just trying to write C code without writing C code (or C++ code).
Perhaps I can abandon (exposing these classes to) the python interpreter altogether, 
and stick to writing pyrex code.

A similar problem occurs with methods. I gave up on duplicating every method
(a cdef version and a python version), and am just using python methods for now.

What am I doing ? I hear java is a good language. Easy to hire java programmers.

FWIW i just finished a 12 month development cycle using rpython to do similar things.
It is interesting comparing the two approaches. Pyrex is a much more mature and useable 
tool, but rpython is a lot of fun too.

Simon.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.