list comprehension question
Johann Spies
johann.spies at gmail.com
Wed Feb 29 08:52:50 EST 2012
More information about the Python-list mailing list
Wed Feb 29 08:52:50 EST 2012
- Previous message (by thread): On u'Unicode string literals' reintroduction (Py3)
- Next message (by thread): list comprehension question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I understand the following: In [79]: instansie instansie Out[79]: 'Mangosuthu Technikon' In [80]: t = [x.alt_name for x in lys] t = [x.alt_name for x in lys] In [81]: t t Out[81]: [] In [82]: t.append(instansie) t.append(instansie) In [83]: t t Out[83]: ['Mangosuthu Technikon'] But then why does the following behave like this: In [84]: t = [x.alt_name for x in lys].append(instansie) t = [x.alt_name for x in lys].append(instansie) In [85]: t t In [86]: type t type t -------> type(t) Out[86]: NoneType Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-list/attachments/20120229/8da6d876/attachment.html>
- Previous message (by thread): On u'Unicode string literals' reintroduction (Py3)
- Next message (by thread): list comprehension question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list