Attack a sacred Python Cow

Russ P. Russ.Paielli at
Tue Jul 29 06:33:15 CEST 2008

On Jul 28, 8:44 pm, alex23 <wuwe... at> wrote:
> On Jul 29, 4:46 am, "Russ P." <Russ.Paie... at> wrote:
> > As I said, I could write a pre-processor myself to
> > implement it in less than a day.

I'm working on something else right now if you don't mind, but I'll
get to it in good time.

Conceptually, the matter is simple. All I need to do is to grab the
first formal argument of each def, then search for occurrences of any
word in the body of the def that starts with a dot, and insert that
first argument in front of it.

I expect the "hard" part will be breaking up the body of the def into
"words." I could just split each line on white space, except for
situations like


So I need to account for the fact that operators do not need to be
surrounded by spaces. That's the hardest part I can think of off the
top of my head.

Maybe I'll encounter an insurmountable problem and realize that the
idea can't work in general. If so, then so be it. Certainly, no one on
this thread has anticipated such a problem. Had someone pointed out an
actual technical problem with the idea, I would have gladly thanked
them. But I got a load of irrelevant crap instead, not to mention
being addressed as "boy."

> If you're meeting so much resistance to your idea, why not scratch
> your own damn itch and just do it?
> Or doesn't that afford you as many chances to insult others while
> feeling smugly superior?

This coming from a guy who insulted my reading comprehension ability
-- when he was the one who was wrong!

More information about the Python-list mailing list