Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feed.xsnews.nl!border-2.ams.xsnews.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; '[1,': 0.09; 'received :mail-vc0-f174.google.com': 0.09; 'cc:addr:python-list': 0.10; 'sat,': 0.15; 'alist': 0.16; 'in-place,': 0.16; 'wrote:': 0.17; 'object.': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'chris': 0.28; 'received:209.85.220.174': 0.29; 'operate': 0.32; 'print': 0.32; 'code:': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'lists.': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'jul': 0.65; 'url:a': 0.72; 'sender:addr:chris': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=F27YpwBZ+BQvN6+o1Nwl8PdlhzzwuHp9PTf1/QZgpY4=; b=ZyKPd2zy6qAecmmyON0WosgdZfBdPcLZGnxLWWhDzU6x9M0QG6zF3cyelVfTsyu+RK c9gkD9vNWgT/BWBRIFH52vd245GlGyJN1z0kLzqiR0F6LK5Wwczq5LqPrIOzK161Ci7a RuRaXvAjjDsRwloTGknnUSGTLOiR0qKj+7otk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=F27YpwBZ+BQvN6+o1Nwl8PdlhzzwuHp9PTf1/QZgpY4=; b=i40tw9yL0Tgf+jBxGA1nM9Ghrv1zyB378iN4xVN28tvDQBvBLGworhOsiNyZ91cNlh t1In4/TN6fklePlO6qtASsCof7L+vFIZhRveq8SvO1JCtUkfsg/hT4dNVxJyPJEd+WYJ oRd+mgNDPKpqn/bhKgAGS88NlM8yb3VDpzYm5eZEajU6/yvlJzLIGJ6LPoEIIhYLU3uP RwOTHvMWHW1gwQ22wx9DGgCVfeWtrC3wd/rC7/sZbFucxYJHBwX1v4XrXTYrSVUbn4KI 9CDZDb/qDnUtqG62s+5eai7K90adQqrLVsye+PRggKEcXS4/rrJ0Q1IL6asJzfuYuaR1 WUBA== MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: References: Date: Sat, 7 Jul 2012 10:35:49 -0700 X-Google-Sender-Auth: 7933ZKFKm0fH1iDB-F-k5Cx1oNQ Subject: Re: something go wrongly From: Chris Rebert To: levi nie Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkCVcGjAFwusZ3dFlcyXsha8SDYSIIgOSgU/YoA+bquwmggrlbI8ChrHcUdNXWLUVHrj+GU Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1341682558 news.xs4all.nl 6968 [2001:888:2000:d::a6]:32902 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25027 On Sat, Jul 7, 2012 at 10:23 AM, levi nie wrote: > my code: > > aList=[1,2,3,4,5,6,7,8,9,10] > xList=[1,2,3] > print "now aList is",aList.extend(xList) > > output: > now aList is None > > what i want is [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3] See http://stackoverflow.com/a/1682601 list.extend(), list.append(), etc. operate in-place, mutating the existing list object. Such methods return None to emphasize that they do not create new lists. Regards, Chris