Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:54:09+00:00 2026-06-14T01:54:09+00:00

I’m constantly wrapping my str.join() arguments in a list, e.g. ‘.’.join([str_one, str_two]) The extra

  • 0

I’m constantly wrapping my str.join() arguments in a list, e.g.

'.'.join([str_one, str_two])

The extra list wrapper always seems superfluous to me. I’d like to do…

'.'.join(str_one, str_two, str_three, ...)

… or if I have a list …

'.'.join(*list_of_strings)

Yes I’m a minimalist, yes I’m picky, but mostly I’m just curious about the history here, or whether I’m missing something. Maybe there was a time before splats?

Edit:

I’d just like to note that max() handles both versions:

max(iterable[, key])
max(arg1, arg2, *args[, key])

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:54:10+00:00Added an answer on June 14, 2026 at 1:54 am

    For short lists this won’t matter and it costs you exactly 2 characters to type. But the most common use-case (I think) for str.join() is following:

    ''.join(process(x) for x in some_input) 
    # or
    result = []
    for x in some_input:
        result.append(process(x))
    ''.join(result)
    

    where input_data can have thousand of entries and you just want to generate the output string efficiently.

    If join accepted variable arguments instead of an iterable, this would have to be spelled as:

    ''.join(*(process(x) for x in some_input))
    # or
    ''.join(*result)
    

    which would create a (possibly long) tuple, just to pass it as *args.

    So that’s 2 characters in a short case vs. being wasteful in large data case.

    History note

    (Second Edit: based on HISTORY file which contains missing release from all releases. Thanks Don.)

    The *args in function definitions were added in Python long time ago:

    ==> Release 0.9.8 (9 Jan 1993) <==

    Case (a) was needed to accommodate variable-length argument lists;
    there is now an explicit “varargs” feature (precede the last argument
    with a ‘*’). Case (b) was needed for compatibility with old class
    definitions: up to release 0.9.4 a method with more than one argument
    had to be declared as “def meth(self, (arg1, arg2, …)): …”.

    A proper way to pass a list to such functions was using a built-in function apply(callable, sequence). (Note, this doesn’t mention **kwargs which can be first seen in docs for version 1.4).

    The ability to call a function with * syntax is first mentioned in release notes for 1.6:

    There’s now special syntax that you can use instead of the apply()
    function. f(*args, **kwds) is equivalent to apply(f, args, kwds). You
    can also use variations f(a1, a2, *args, **kwds) and you can leave one
    or the other out: f(args), f(*kwds).

    But it’s missing from grammar docs until version 2.2.

    Before 2.0 str.join() did not even exists and you had to do from string import join.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.