[Tutor] wiki madness grows one you like a brain fungus
Kirk Bailey
idiot1 at netzero.net
Sun Aug 10 12:58:51 EDT 2003
Raymond Hettinger wrote:
> ----- Original Message -----
> From: "Kirk Bailey" <idiot1 at netzero.net>
> Cc: <tutor at python.org>
> Sent: Saturday, August 09, 2003 6:43 PM
> Subject: Re: [Tutor] wiki madness grows one you like a brain fungus
>
>
>
>
>>Now you get layout ok, and it is still converting words into links or into
>>wikiwords. USUALLY they are right. It is throwing some noise in the process I
>>cannot understand. This puzzles me.
>>
>>here are the links.
>>sourcecode:
>>http://www.tinylist.org/wikinehesa.txt
>
> . . .
>
>>ANYONE, please take a look and tell me when to shoot this thing.
>>And where. WHERE is of particular intrest, SOMETHING here DESPERATELY needs a
>>bullet.
>
>
> Here's a compact, faster version of iswikiword():
>
> import re
> wikiword = re.compile('[A-Z][^A-Z]+[A-Z]').search
> def iswikiword(word, wikiword = re.compile('[A-Z][^A-Z]+[A-Z]').search):
> return wikiword(word) is not None
>
Know why I wrote it that way?
Cause I don' comprehend re worth a damn is why. Thanks for the words of power. I
will try it.
>
> For Py2.3, the "in" keyword works just like your isin() function:
>
Hoa about 1.5.2? OLd server, alas. Due for upgrade REAL SOON NOW...
> if 'http://' in word:
>
> In wordsplit(), there is a bug -- you meant to return (newword, extras)
> instead of (word, extras). Also, building the strings through
> character appends is very slow -- use str.join instead.
> Also, the search runs faster if "punctuation" is kept in a dictionary.
>
oops... wil fix soonest.
> Overall, the code is fairly compact and nice.
My blushes sir, thank you! :-)
> Considering using docstrings instead of prolific comments on every line.
> The code will look *much* more beautiful.
Hmmmm...
At least I comment generously. You want to look at the inspiration, piki?
Wonder guy, but Martin don' comment worth a tinker's scream in hell. That sort
of programming is, um, mysterious. Rather, that sort of MINDSET is a mystery.
>
>
> Raymond Hettinger
>
>
>
>
>
>>
>>--
>>
>>end
>>
>>Cheers!
>> Kirk D Bailey
>
>
>
>
>
--
--
end
Cheers!
Kirk D Bailey
+ think +
http://www.howlermonkey.net +-----+ http://www.tinylist.org
http://www.listville.net | BOX | http://www.sacredelectron.org
Thou art free"-ERIS +-----+ 'Got a light?'-Promethieus
+ think +
Fnord.
More information about the Tutor
mailing list