CPython internal design question

Courageous jkraska at san.rr.com
Fri Dec 14 18:30:25 EST 2001


>In this case "im" is (presumably) short for Instance Method, in all cases it
>makes it easy to find field references in the code base via simple search
>mechanisms, and in some cases it's a helpful reminder of what kind of object
>referencing code is mucking with.  Note that there are more than 5,000
>instances of the identifier "self" in the C portion of the Python code base.
>If you're specifically looking for uses of "self" in instance method
>structs, that there are only 18 hits on im_self greatly eases the task.
>
>the-simpler-the-conventions-the-simpler-the-needed-tools-ly y'rs  - tim

That makes sense, thanks. I'll have to consider that in light of
other projects. It's a good convention. Of course one convention
that Python uses internally that really annoys the devil out of
me is defining functions like this:

ReturnType
MyFunction ( ... );

Why? Greppying through the file will fail to yield the return
type of the function.

BLEACH. I HATE that. :)

C//




More information about the Python-list mailing list