Message from discussion
A question about lists and strings
Received: by 10.181.11.234 with SMTP id el10mr364301wid.2.1344596793803;
Fri, 10 Aug 2012 04:06:33 -0700 (PDT)
Path: q11ni58432953wiw.1!nntp.google.com!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path: <vashkevic...@gmail.com>
X-Original-To: python-l...@python.org
Delivered-To: python-l...@mail.python.org
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'subject::
[': 0.03; 'output': 0.04; 'subject:question': 0.08; 'arguments,':
0.09; 'explanation': 0.09; 'follows.': 0.09; 'happens.': 0.09;
'objects.': 0.09; 'received:mail-lpp01m010-f46.google.com': 0.09;
'cc:addr:python-list': 0.10; '>the': 0.16; 'concatenated': 0.16;
'mutated': 0.16; 'nonetheless': 0.16; 'string': 0.17; 'creates':
0.18; 'handles': 0.18; 'subject:] ': 0.19; 'parameters': 0.20;
'explicit': 0.22; 'x-mailer:apple mail (2.1084)': 0.22; 'cc:2**0':
0.23; 'statement': 0.23; 'cc:no real name:2**0': 0.24;
'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'str':
0.29; 'url:mailman': 0.29; 'handled': 0.29;
'received:209.85.215.46': 0.30; 'returned': 0.30; 'function':
0.30; 'lists': 0.31; 'url:python': 0.32; 'subject:lists': 0.32;
'print': 0.32; 'url:listinfo': 0.32; 'right?': 0.33;
'received:google.com': 0.34; 'thanks': 0.34; 'list': 0.35;
'expected': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'message-
id:@gmail.com': 0.36; 'url:org': 0.36; 'passed': 0.37;
'received:209': 0.37; 'nothing': 0.38; 'takes': 0.39; 'called':
0.39; 'header:Received:5': 0.40; 'url:mail': 0.40; 'header
:Message-Id:1': 0.62; 'different': 0.63; 'more': 0.63;
'received:ru': 0.81; 'dealt': 0.91; 'str.': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
h=subject:mime-version:content-type:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to:x-mailer;
bh=TkBkTPU52uFA0J1mR4nJm+o5YmIDv/C0cX4wp/+s24c=;
b=uE/2LufoqSDxuzfaBj1ICmIbr/Hkect2u+MF1zPM4d6ev0d4XnOrysthTU03ol2a4Q
gZpPI6I6h+MgMtZ8qf7Slsz2Sv6O4DFPgfz9qh7qF4UIzAG+pRH2OcwTSNs+OFUDpk1P
h4bjWZe/38Ug12/RSUaEmcYMu/Ev6N7G0v0YU4uITH2dycz680wTEtZf17HjAqGhSw4V
p3DfkE6g80wncDuh58OpfZDrFbbeuhCDGKsJQttJSLU/vJJfvaW10fUUbVTdvEiQNgED
SjJa79VWF8/p6qQge1AYkfDqCw34CzKQqHHv8J5H+37rwMR+dTcGg+4CSI2zFayPje4V
qfoA==
Subject: Re: [newbie] A question about lists and strings
Mime-Version: 1.0 (Apple Message framework v1084)
From: Roman Vashkevich <vashkevic...@gmail.com>
In-Reply-To: <k02mpk$p0...@news.albasani.net>
Date: Fri, 10 Aug 2012 15:06:14 +0400
References: <k02jn0$id...@news.albasani.net>
<39A401F0-12DD-464F-A0D1-639C56FA4...@gmail.com>
<mailman.3148.1344592099.4697.python-l...@python.org>
<k02mpk$p0...@news.albasani.net>
To: Mok-Kong Shen <mok-kong.s...@t-online.de>
X-Mailer: Apple Mail (2.1084)
Cc: python-l...@python.org
X-BeenThere: python-l...@python.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/options/python-list>,
<mailto:python-list-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list>
List-Post: <mailto:python-l...@python.org>
List-Help: <mailto:python-list-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-requ...@python.org?subject=subscribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.3159.1344596778.4697.python-l...@python.org>
Lines: 27
NNTP-Posting-Host: 2001:888:2000:d::a6
X-Trace: 1344596778 news.xs4all.nl 6977 [2001:888:2000:d::a6]:51591
X-Complaints-To: ab...@xs4all.nl
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: quoted-printable
10.08.2012, =D7 14:12, Mok-Kong Shen =CE=C1=D0=C9=D3=C1=CC(=C1):
> Am 10.08.2012 11:48, schrieb Roman Vashkevich:
>> [snip]
> >The function .... It takes list by reference and creates a new local
> > str. When it's called with listb and strb arguments, listb is passed
> > by reference and mutated. A string "sss" is concatenated with an
> > empty local str. Nothing more happens. Since local str is not
> > returned by xx(), it can not be expected to be printed out in the
> > statement that follows. What is printed out in the print statement =
is
> > the mutated listb and the global strb.
>=20
> Thanks for the explanation of the output obtained. But this means
> nonetheless that parameters of types lists and strings are dealt with
> in "inherently" (semantically) different ways by Python, right?
>=20
> M. K. Shen
>=20
> --=20
> http://mail.python.org/mailman/listinfo/python-list
DaveA provided a very explicit explanation of how py handles list and =
string objects.
Parameters are handled "inherently" by functions...
RV=