On Tue, 15 Sep 2009 14:31:26 +0200, Ulrich Eckhardt wrote:
> Hi!
>
> "'abc'.split('')" gives me a "ValueError: empty separator". However,
> "''.join(['a', 'b', 'c'])" gives me "'abc'".
>
> Why this asymmetry?
The docs say
"If sep is given, consecutive delimiters are not grouped together and a
On Tuesday 15 September 2009 14:50:11 Xavier Ho wrote:
> On Tue, Sep 15, 2009 at 10:31 PM, Ulrich Eckhardt
>
> wrote:
> > "'abc'.split('')" gives me a "ValueError: empty separator".
> > However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
> >
> > Why this asymmetry? I was under the impression that
Vlastimil Brom wrote:
2009/9/15 Ulrich Eckhardt :
Hi!
"'abc'.split('')" gives me a "ValueError: empty separator".
However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
Why this asymmetry? I was under the impression that the two would be
complementary.
Uli
maybe it isn't quite obvious, what
2009/9/15 Ulrich Eckhardt :
> Hi!
>
> "'abc'.split('')" gives me a "ValueError: empty separator".
> However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
>
> Why this asymmetry? I was under the impression that the two would be
> complementary.
>
> Uli
>
maybe it isn't quite obvious, what the behav
Ulrich Eckhardt wrote:
Hi!
"'abc'.split('')" gives me a "ValueError: empty separator".
However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
Why this asymmetry? I was under the impression that the two would be
complementary.
Uli
I think the problem is that join() is lossy; if you try "".
On Tue, Sep 15, 2009 at 10:31 PM, Ulrich Eckhardt
wrote:
> "'abc'.split('')" gives me a "ValueError: empty separator".
> However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
>
> Why this asymmetry? I was under the impression that the two would be
> complementary.
>
I'm not sure about asymmetry,
Hi!
"'abc'.split('')" gives me a "ValueError: empty separator".
However, "''.join(['a', 'b', 'c'])" gives me "'abc'".
Why this asymmetry? I was under the impression that the two would be
complementary.
Uli
--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
-