Skip to content

bpo-27639: slices of UserLists should be instances of UserList#4981

Closed
vaultah wants to merge 1 commit intopython:masterfrom
vaultah:userlist-slice
Closed

bpo-27639: slices of UserLists should be instances of UserList#4981
vaultah wants to merge 1 commit intopython:masterfrom
vaultah:userlist-slice

Conversation

@vaultah
Copy link
Copy Markdown

@vaultah vaultah commented Dec 22, 2017

@vaultah
Copy link
Copy Markdown
Author

vaultah commented Dec 22, 2017

I noticed that __init__ creates an unnecessary copy of initlist.data:

self.data[:] = initlist.data[:]

and __iadd__ converts its second argument to list in some cases:

self.data += list(other)

I removed the slice part from the former, but I'm wondering if self.data += list(other) has any advantages over self.data += other.

@methane
Copy link
Copy Markdown
Member

methane commented Apr 5, 2019

LGTM.

@vaultah Could you add your name in Misc/ACKS, and add "Patch by " in NEWS entry?

@rhettinger Would you review this?

@vaultah
Copy link
Copy Markdown
Author

vaultah commented Apr 7, 2019

My name is already in Misc/ACKS. I'm not interested in updating this patch. If it's possible, you may merge it without a name or under your name.

@vaultah vaultah closed this May 6, 2019
@mblahay
Copy link
Copy Markdown
Contributor

mblahay commented May 7, 2019

:( I'm sorry, didn't know this was out there since it wasn't attached to the ticket. Will review what you have done as it seems to be more than what Erick Cervantes and I had and will use what is valid. Most of all, I will make sure your name is listed some where as contributing to this, as soon as I find out where that some where is. Thank you for your efforts!

@mblahay
Copy link
Copy Markdown
Contributor

mblahay commented May 7, 2019

I have reviewed the changes and it in addition to resolving the problem stated in ticket 27639, there are two other changes. One, in init, you identify above. My team agrees that this change is a good performance improver.

The second one involves what appears to be a modification to _setitem that corresponds to the modification to getitem. The problem is that it is unclear why setitem needs to be modified. It works fine without any changes. Vaultah, I would very much like for you to explain it to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants