[Tutor] bytecode primer, and avoiding a monster download

Jim Mooney cybervigilante at gmail.com
Tue May 28 22:15:38 CEST 2013


On 28 May 2013 04:18, Dave Angel <davea at davea.name> wrote:
> On 05/28/2013 07:02 AM, Jim Mooney wrote:

> Alan and Devin already gave more specifics, but to repeat,
>
> import dis
>
> dis.dis(myfunction)
>
> will disassemble one function.

I think authors miss a didactic opportunity by not using bytecode as a
teaching tool now and then, since it's easily explained, at least for
basic statements. Some concepts seem hard to get across in English but
are obvious when you actually see what they do, step-by-step. Not true
for everything for course, but for some things.

I guess it has to do with sales. If someone new to any programming
opens a Python book to buy and sees all these prettily laid-out Python
statements that look almost like natural language, only more ordered,
but then sees a page of bytecode, they'd probably drop the book  and
run ;')

Jim


More information about the Tutor mailing list