Python Data Utils

Jesse Aldridge JesseAldridge at gmail.com
Mon Apr 7 02:22:03 EDT 2008


> Docstrings go *after* the def statement.

Fixed.

> changing "( " to "(" and " )" to ")".

Changed.


I attempted to take out everything that could be trivially implemented
with the standard library.
This has left me with... 4 functions in S.py.  1 one of them is used
internally, and the others aren't terribly awesome :\  But I think the
ones that remain are at least a bit useful :)

> The penny drops :-)

yeah, yeah

> Not in all places ... look at the ends_with function. BTW, this should
> be named something like "fuzzy_ends_with".

fixed

> fuzzy_match(None, None) should return False.

changed

> 2. make_fuzzy function: first two statements should read "s =
> s.replace(.....)" instead of "s.replace(.....)".

fixed

> 3. Fuzzy matching functions are specialised to an application; I can't
> imagine that anyone would be particularly interested in those that you
> provide.

I think it's useful in many cases.  I use it all the time.  It helps
guard against annoying input errors.

> A basic string normalisation-before-comparison function would
> usefully include replacing multiple internal whitespace characters by
> a single space.

I added this functionality.


> 5. Casual inspection of your indentation function gave the impression
> that it was stuffed

Fixed

Thanks for the feedback.



More information about the Python-list mailing list