Language documentation ( was Re: Computing Industry shams)

alex goldman hello at spamm.er
Tue May 10 07:58:48 EDT 2005


Sean Burke wrote:

> 
> alex goldman <hello at spamm.er> writes:
> 
>> vermicule wrote:
>> 
>> > 
>> > What is so hard to understand ?
>> > Should be perfectly clear even to a first year undergraduate.
>> > 
>> > As for "greedy" even a minimal exposure to Djikstra's shortest path
>> > algorithm would have made the concept intuitive. And from memory,
>> > that is the sort of thing done in Computing 101 and in  Data Structures
>> > and Algorithms 101
>> > 
>> > It seems to me that you want the Python doc to be written for morons.
>> > And that is not a valid complaint.
>> 
>> He's right actually. If we understand the term "greedy" as it's used in
>> graph search and optimization algorithms, Python's RE matching actually
>> IS greedy.
> 
> No, you're just confused about the optimization metric.
> In regexes, "greedy" match optimizes for the longest match,
> not the fastest.
> 
> And this is common regex terminology - man perlre and you will
> find discussion of "greedy" vs. "stingy" matching.

Read what you quoted again. Everyone (Xah, vermicule, myself) was talking
about "greedy" as it's used in graph search and optimization algorithms.



More information about the Python-list mailing list