Re: [Python-Dev] Proof of the pudding: str.partition()
30 Aug
2005
30 Aug
'05
11:06 p.m.
Shane Hathaway wrote:
Ron Adam wrote:
For cases where single values are desired, attribues could work.
Slicing: line = line.partition(';').head line = line.partition('#').head
But it gets awkward as soon as you want more than one.
sep, port = host.partition(':').head, host.partition(':').sep
You can do both: make partition() return a sequence with attributes, similar to os.stat(). However, I would call the attributes "before", "sep", and "after".
+0 I thought the same thing. I don't see a lot of use cases for it, but it could be useful. I don't see how it could hurt. Tim Delaney
6813
Age (days ago)
6813
Last active (days ago)
0 comments
1 participants
participants (1)
-
Delaney, Timothy (Tim)