On Apr 29, 1:05 pm, Scott David Daniels <scott.dani...@acm.org> wrote:
> Bruno Desthuilliers wrote:
> > d = {}
> > for line in open(thefile):
> >    arr = line.strip().split()
> >    d[arr[0]] = arr
>
> Sorry, not picking on Bruno in particular, but I keep seeing
> this formulation around various places.
> When does line.strip().split() ever differ from line.split()?
>
> --Scott David Daniels
> scott.dani...@acm.org

They don't.
It is probably out of habit of using the generalized idiom:
>>> line="a,b,c\n"
>>> line.strip().split(",")
['a', 'b', 'c']
>>> line.split(",")
['a', 'b', 'c\n']
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to