Re: [Python-ideas] min_fields argument to str.split()

Jan. 22, 2009
2:58 a.m.
NOTE: It was brought to my attention that my last e-mail message arrived completely garbled. Here it is again, as I meant to send it. My Apologies to everyone.
+1 from me too. Way better than the generator I proposed. Having this as a function also makes it applicable to much more than just one use case. If you see the following code: a,b,c,d = fixlen(str.split(),4) You immediately know it's not a regular unpacking operation; it will be the first place you look if something goes wrong. Vitor
5900
Age (days ago)
5900
Last active (days ago)
0 comments
1 participants
participants (1)
-
Vitor Bosshard