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: a=[1,2,3] a=a.extend([4]) after running these two lines of code a is None,but it should be [1,2,3,4]
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.9, Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, wei gu
Priority: normal Keywords:

Created on 2020-04-30 13:00 by wei gu, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
error.png wei gu, 2020-04-30 13:02
Messages (1)
msg367756 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2020-04-30 13:06
list.extend modifies the list in place. Like most mutating methods in python, it does not return the thing being modified.

Everything is working correctly, and it's documented this way.
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84630
2020-04-30 13:06:49eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg367756

resolution: wont fix -> not a bug
stage: resolved
2020-04-30 13:03:38wei gusettitle: a=[1,2,3] a=a.extend([4]) after running these two lines of code a is None,but it show be [1,2,3,4] -> a=[1,2,3] a=a.extend([4]) after running these two lines of code a is None,but it should be [1,2,3,4]
2020-04-30 13:02:47wei gusetfiles: + error.png
title: wrong -> a=[1,2,3] a=a.extend([4]) after running these two lines of code a is None,but it show be [1,2,3,4]
resolution: wont fix
versions: + Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
components: + Interpreter Core
type: behavior
2020-04-30 13:00:47wei gucreate