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".
Shane
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com