Another Python rookie trying to port to C/C++ question.
Don Bruder
dakidd at sonic.net
Thu Sep 25 17:25:27 EDT 2003
In article <8yoc1wwt.fsf at python.net>,
Thomas Heller <theller at python.net> wrote:
> Don Bruder <dakidd at sonic.net> writes:
>
> [rewriting a Python program in C/C++]
> > Something like this C construct:
> >
> > struct DictStruct
> > {
> > char *KeyArray[<somenumber>];
> > ValType ValArray[<somenumber>];
> > }
> >
> [...]
> > Similarly, would something like:
> >
> > struct DictStruct
> > {
> > char Key[25];
> > ValType Value;
> > DictStruct *PrevDictEntry;
> > DictStruct *NextDictEntry;
> > }
> >
> > [...] end up behaving at least reasonably like a Python "dict"?
>
> Yes.
>
> Except that it would be less flexible, *much* slower, and
> probably much more buggy.
>
> Thomas
Well, since I'm not worried about "flexible", have my doubts about the
"much slower" part, and have no reason to believe that choice of
language automatically makes a routine buggy, I'll go with the tenative
plan I had. Seems you're confirming that I'm understanding things
properly when it comes to "This is what a dict is, and here's how it
works." Now to put finishing touches on my understanding of exactly what
goes on inside that "black box" that is the "dict"
class/type/whatever-it-is-you-Python-types-like-to-call-such-things, and
make some working code out of it...
--
Don Bruder - dakidd at sonic.net <--- Preferred Email - SpamAssassinated.
Hate SPAM? See <http://www.spamassassin.org> for some seriously great info.
I will choose a path that's clear: I will choose Free Will! - N. Peart
Fly trap info pages: <http://www.sonic.net/~dakidd/Horses/FlyTrap/index.html>
More information about the Python-list
mailing list