[issue37684] list.extend docs inaccurate

2019-07-26 Thread Kyle Stanley
Kyle Stanley added the comment: Upon further consideration, I think the code example suggestion I made using the interpreter could be in a separate PR or issue and doesn't have to replace the the current "Equivalent to ..." portion. I'll open a separate PR for that (which isn't attached to

[issue37684] list.extend docs inaccurate

2019-07-26 Thread wim glenn
wim glenn added the comment: Raymond, I understand that consecutive appends could potentially trigger multiple resizes behind the scenes, and so it's not really showing that extend is more like a bulk update as you mentioned. That's a good point! However I think it's a more important

[issue37684] list.extend docs inaccurate

2019-07-26 Thread Kyle Stanley
Kyle Stanley added the comment: Raymond, what were your thoughts on the alternative suggestion I posted on the GitHub PR? My suggestion might have been too different from the original PR, but personally I think it's a bit more appropriate for the tutorial than the existing example. Would it

[issue37684] list.extend docs inaccurate

2019-07-26 Thread Kyle Stanley
Kyle Stanley added the comment: Clarification: Since I posted two potential suggestions, I'm referring to the one using the interpreter, not the one that changed it into two lines and added indentation. -- ___ Python tracker

[issue37684] list.extend docs inaccurate

2019-07-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the suggestion, but I'm going to reject this. The existing rough equivalent isn't exact but it does do a better job of communicating a bulk update rather than a series of appends. Also, it isn't far from how the C list_extend() is actually

[issue37684] list.extend docs inaccurate

2019-07-25 Thread wim glenn
Change by wim glenn : -- keywords: +patch pull_requests: +14720 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14951 ___ Python tracker ___

[issue37684] list.extend docs inaccurate

2019-07-25 Thread wim glenn
New submission from wim glenn : >From https://docs.python.org/3/tutorial/datastructures.html#more-on-lists : list.extend(iterable) Extend the list by appending all the items from the iterable. Equivalent to a[len(a):] = iterable. The "equivalent" is not very good. Consider