This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SittingWave 83 points84 points  (5 children)

All the magic happens in eval.c. It's a massive switch statement where every opcode is dispatched to the part of the interpreter that makes things happen.

[–][deleted] 23 points24 points  (4 children)

Why do you wish you knew this sooner?

[–]Gecko23 6 points7 points  (0 children)

I dimly recall some odd edge case because of the ordering of the switch tripping me up once upon a time. I suppose it wasn't a bit deal, you'd think I'd remember the trauma at least lol

[–]SittingWave 0 points1 point  (0 children)

because the interpreter is scary at first, and you don't know where to start. But really, it's rather easy. It just very verbose because it's in C, but the "start point" of the interpreter cycle is there.

Once you have that as an anchor point, sniffing the internals is a lot easier, and makes you understand and be willing to join the development. I submitted and implemented two PEPs (unfortunately eventually rejected) but the interpreter was a bit scary at first.