Martin v. Löwis added the comment:

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.

----------
nosy: +loewis
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15614>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to