Why is the interpreter is returning a 'reference'?

Joel Goldstick joel.goldstick at gmail.com
Mon Feb 17 18:08:37 CET 2014


On Feb 17, 2014 12:05 PM, "Nir" <nirchernia at gmail.com> wrote:
>
> >>> k = ['hi','boss']
> >>>
> >>> k
> ['hi', 'boss']
> >>> k= [s.upper for s in k
S.upper()
> >>> k
> [<built-in method upper of str object at 0x00000000021B2AF8>, <built-in
method upper of str object at 0x0000000002283F58>]
>
> 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.
> --
> https://mail.python.org/mailman/listinfo/python-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140217/64feab23/attachment.html>


More information about the Python-list mailing list