[Tutor] str.split and quotes

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Apr 8 03:32:53 CEST 2005


> > I'm not sure if this is appropriate for Marilyn's purposes though, but
> > I thought I might just toss it out.  *grin*
>
> Thank you Danny.  Very interesting.  Both approaches are perfect for
> me.
>
> Is there a reason to prefer one over the other?  Is one faster?  I
> compiled my regular expression to make it quicker.

Hi Marilyn,

I think that Kent's approach is better because it's simpler.  Unlike the
'tokenize' module approach, the 'csv' module is conceptually not closely
coupled to Python.  The 'tokenize' module, on the other hand, uses
Python's rules for tokenization, and they might not fit your purposes as
well.



More information about the Tutor mailing list