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 9175387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:54:18+00:00 2026-06-17T16:54:18+00:00

The analogue for strings holds true: string1 = ‘abc’ ”.join(string1) == string1 # True

  • 0

The analogue for strings holds true:

string1 = 'abc'
''.join(string1) == string1 # True

So why doesn’t this hold true:

list1 = ['a', 'b', 'c']
[].extend(list1) == list1 # AttributeError: 'NoneType' object has no attribute 'extend'

type([]) returns list. Why would it get perceived as a NoneType instead of a list which would have the extend method?

This is an academic question. I wouldn’t do this is regular code, I just want to understand.

  • 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-17T16:54:19+00:00Added an answer on June 17, 2026 at 4:54 pm

    Because list.extend() modifies the list in place and does not return the list itself. What you’d need to do to get what you expect is:

    lst = ['a', 'b', 'c']
    cplst = []
    cplst.extend(lst)
    cplst == lst
    

    The functions you reference are not really analogous. join() returns a new string created by concatenating the members of an iterator together with the string being joined on. An analogous list operation would look more like:

    def JoiningList(list):
    
        def join(self, iterable):
            new_list = iterable[0]
            for item in iterable[1:]:
                new_list.extend(self)
                new_list.append(item)
            return new_list
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is sort of the Java analogue of this question about C# . Suppose
analogue to this one ( Replacing XML in File from "Document" in Java or
Is there an analogue of this tool (maybe python/ruby/etc) which runs under windows? It
Is there any analogue for unix command substitution shell expansion? Like > cmd1 `cmd2
Is there analogue of Django Messages Framework (or RoR flash messages) in Java? http://docs.djangoproject.com/en/dev/ref/contrib/messages/
Does an analogue to Java's Math.rint exist in Python? If not, how can I
Is there a git find analogue of git grep , i.e., something that will
i need to convert French text to most correct analogue in ASCII. Let me
What is an SQLite 3 (3.7.11) analogue of MySQL's mysql -p -u username database_name
I want to use some GUI-object for output some table's information (this information 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.