CPython internal design question

Daniel Berlin dan at cgsoftware.com
Fri Dec 14 19:11:07 EST 2001


On Fri, 14 Dec 2001, Courageous wrote:

>
> >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?

probably so you can find the definition of the function easily.

grep ^MyFunction will find it, without getting false hits on
uses.





More information about the Python-list mailing list