Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Re: Perl vs. Python: Looking at the Code

by mothra (Hermit)
on Apr 03, 2002 at 19:50 UTC ( #156413=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Perl vs. Python: Looking at the Code
in thread Perl vs. Python: Looking at the Code

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re: Re: Re: Re: Perl vs. Python: Looking at the Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Perl vs. Python: Looking at the Code
by buckaduck (Chaplain) on Apr 03, 2002 at 20:26 UTC
    We weren't talking about array concatenation, but if that's what you want to do:
    array = array + list
    I could do the same with Perl:
    @array = (@array, @list);
    But I don't see how that helps your case. Perl's push is shorter than either of these:
    push @array,@list;
    And Python's append() would also be shorter:
    array.append(list)

    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...

    buckaduck

    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://156413]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-05-25 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (90 votes). Check out past polls.

    Notices?