|Pathologically Eclectic Rubbish Lister|
Re: Re: Re: Re: Re: Perl vs. Python: Looking at the Codeby buckaduck (Chaplain)
|on Apr 03, 2002 at 20:26 UTC||Need Help??|
We weren't talking about array concatenation, but if that's what you want to do:
I could do the same with Perl:
But I don't see how that helps your case. Perl's push is shorter than either of these:
And Python's append() would also be shorter:
But from your previous comment I presume that append() will not accept a list as a parameter. I think I probably want extend() for that last example.
Of course, the length comparisons vary, depending on your variable names and your willingness to sacrifice legibility. But I don't think that's an argument that anybody wants to make.
Slightly offtopic: I'm just amazed that Python allows more than one way to do something. I thought that was supposed to be evil or something...