This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients laki, loewis
Date 2012-08-10.08:58:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344589094.3.0.980341755863.issue15614@psf.upfronthosting.co.za>
In-reply-to
Content
This is not a bug. extend is a procedure with a side effect: the "self" object (i.e. "a" in your example) is modified.

By convention, procedures return None in Python, as opposed to functions, which have no side effect but return a result. This is to avoid code like

def combine(a, b):
  return a.extend(b)

a = ...
b = ...
c = combine(a,b)

If extend would return the "self" list, then people may think that they get a fresh, new list, and then wonder why a is modified.

IOW: your bug report is actually invalid; the result that print shows is exactly the right result that extend returns.
History
Date User Action Args
2012-08-10 08:58:14loewissetrecipients: + loewis, laki
2012-08-10 08:58:14loewissetmessageid: <1344589094.3.0.980341755863.issue15614@psf.upfronthosting.co.za>
2012-08-10 08:58:13loewislinkissue15614 messages
2012-08-10 08:58:13loewiscreate