[Python-3000] A better way to initialize PyTypeObject

Guido van Rossum guido at python.org
Sat Dec 2 23:49:03 CET 2006

My preference is for a table-based version over a "lots-of-calls"
approach. I think the idea of using predefined (integer) constants
instead of string constants fits fine into the table-based approach.
However I'm not sure that a string-based approach is necessarily bad
-- we use that now for everything that's not a special method after
all. I do get the point that the string-based approach uses more
memory and needs more processing time.

On 12/2/06, Fredrik Lundh <fredrik at pythonware.com> wrote:
> Talin wrote:
> > So I don't think it's the case that nobody's even bothered to look at
> > Larry's patch
> so are you basing your patch on his work?
>  > People have looked at the patch and suggested taking a different
>  > approach.
> really?  I haven't seen much of a consensus for the string-literals
> instead of constants approach, especially not from experienced extension
> writers.  personally, I think it's butt-ugly, a lot more error-prone
> than any alternative, and I also doubt that it'll save much space in
> practice.  it also ignores history; the Xt developers tried the same
> thing, and ended up adding #define's for all their string literals to
> get a least a little help from the compiler...
> </F>
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-3000 mailing list