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.

classification
Title: x=[1,2,3].append([1,2,3]) bug
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: lenivaya10001, paul.moore, steve.dower, tim.golden, xiang.zhang, zach.ware
Priority: normal Keywords:

Created on 2015-10-10 15:37 by lenivaya10001, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pybug.jpg lenivaya10001, 2015-10-10 15:37 jpg printscreen
Messages (2)
msg252718 - (view) Author: grafika (lenivaya10001) Date: 2015-10-10 15:37
>>> [1,2,3].append([1,2,3])  
>>>                          
>>> x=[1,2,3].append([1,2,3])
>>> x                        
>>> x                        
>>> type(x)                  
<class 'NoneType'>           
>>> x=[1,2,3]                
>>> x.append([1,2,3])        
>>> x                        
[1, 2, 3, [1, 2, 3]]         
>>>
msg252724 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2015-10-10 16:15
This is the right behaviour.

x=[1, 2, 3].append([1, 2, 3]) acts as:

    x=([1, 2, 3].append([1, 2, 3])

Since append is a in-place operation it return None. Then x is None.
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69550
2015-10-10 16:39:47eric.smithsetstatus: open -> closed
resolution: not a bug
stage: resolved
2015-10-10 16:15:33xiang.zhangsetnosy: + xiang.zhang
messages: + msg252724
2015-10-10 15:37:55lenivaya10001create