Python Data Utils

Jesse Aldridge JesseAldridge at gmail.com
Sun Apr 6 10:32:27 EDT 2008


Thanks for the detailed feedback.  I made a lot of modifications based
on your advice.  Mind taking another look?

> Some names are a bit obscure - "universify"?
> Docstrings would help too, and blank lines

I changed the name of universify and added a docstrings to every
function.

> ...PEP8

I made a few changes in this direction, feel free to take it the rest
of the way ;)

> find_string is a much slower version of the find method of string objects,  

Got rid of find_string, and contains.  What are the others?

> And I don't see what you gain from things like:
> def count( s, sub ):
>      return s.count( sub )

Yeah, got rid of that stuff too.  I ported these files from Java a
while ago, so there was a bit of junk like this lying around.

> delete_string, as a function, looks like it should delete some string, not  
> return a character; I'd use a string constant DELETE_CHAR, or just DEL,  
> it's name in ASCII.

Got rid of that too :)

> In general, None should be compared using `is` instead of `==`, and  
> instead of `type(x) is type(0)` or `type(x) == type(0)` I'd use  
> `isinstance(x, int)` (unless you use Python 2.1 or older, int, float, str,  
> list... are types themselves)

Changed.

So, yeah, hopefully things are better now.

Soon developers will flock from all over the world to build this into
the greatest data manipulation library the world has ever seen!  ...or
not...

I'm tired.  Making code for other people is too much work :)



More information about the Python-list mailing list