Skip to content

add deque __iadd__ method - #2843

Merged
youknowone merged 1 commit into
RustPython:masterfrom
eldpswp99:add_deque_iadd
Aug 11, 2021
Merged

youknowone merged 1 commit into
RustPython:masterfrom
eldpswp99:add_deque_iadd

Conversation

@eldpswp99

@eldpswp99 eldpswp99 commented Aug 11, 2021 •

Copy link
Copy Markdown
Contributor

resolve #2838

add deque.__iadd__ method

vm: &VirtualMachine,
) -> PyResult<PyRef<Self>> {
let other: PyObjectRef = if zelf.is(&other) {
vm.new_pyobj(zelf.copy())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by calling here new_pyobj and calling try_from_object later, this is making unnessessary PyObjectRef.

@eldpswp99

Copy link
Copy Markdown
Contributor Author

the unccessary pyObject was created due to extend bug regard to recursive call , i'll fix extend method first and fix this later

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, It looks more like extend problem not __iadd__ one. I will merge this PR for now. We can fix it when extend is fixed later.

Thank you for contributing!

@youknowone
youknowone merged commit 56469ae into RustPython:master Aug 11, 2021
@youknowone youknowone added the z-ca-2021 Tag to track contrubution-academy 2021 label Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

z-ca-2021 Tag to track contrubution-academy 2021

Projects

None yet

Development

Successfully merging this pull request may close these issues.

collections.deque doesn't have __iadd__ method.

2 participants