Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Why is the interpreter is returning a 'reference'? Date: Mon, 17 Feb 2014 19:17:07 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 21 Message-ID: References: <9b80c233-ad31-44c8-8a6e-9002ab11bd0d@googlegroups.com> NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1392664627 5097 166.84.1.1 (17 Feb 2014 19:17:07 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 17 Feb 2014 19:17:07 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:66621 In <9b80c233-ad31-44c8-8a6e-9002ab11bd0d@googlegroups.com> Nir writes: > >>> k = ['hi','boss'] > >>> > >>> k > ['hi', 'boss'] > >>> k= [s.upper for s in k] > >>> k > [, ] > Why doesn't the python interpreter just return > ['HI, 'BOSS'] ? > This isn't a big deal, but I am just curious as to why it does this. Because you typed 'str.upper' instead of 'str.upper()'. -- John Gordon Imagine what it must be like for a real medical doctor to gordon@panix.com watch 'House', or a real serial killer to watch 'Dexter'.