FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add itertools.chain.__setstate__ by nonzerofloat · Pull Request #3779 · RustPython/RustPython · GitHub

Repository navigation

Add itertools.chain.__setstate__ - #3779

Closed
nonzerofloat wants to merge 1 commit into
RustPython:mainfrom
nonzerofloat:issue1
Closed

nonzerofloat wants to merge 1 commit into
RustPython:mainfrom
nonzerofloat:issue1

Conversation

Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Member

@nonzerofloat you may forgot to set git config user.email

nonzerofloat commented Jun 11, 2022 •
edited
Loading

Copy link
Copy Markdown
Author

Generally git do not allow commits without an email registered. That's perhaps because the commit's email is not consistent with my account's email. I have fixed.

Correct lint errors.

Comment thread vm/src/stdlib/itertools.rs Outdated
impl IterNextIterable for PyItertoolsChain {}
impl IterNext for PyItertoolsChain {
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
let iterables = zelf.iterables.read();

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This change may cause dead-lock

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you give me more detailed explanation for deadlock? I suspect the place is suitable. Deadlock is unexpected.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Guess we have a chain with self-editing iterable on __iter__. Previously, we locked iterable only before and after get_iter, it is safe.
After change, this line will hold the lock for entire loop. Any write operation in get_iter will be permanently blocked.

Copy link
Copy Markdown
Contributor

The implementation of itertools.chain has changed with #3788. I guess we should rebase this MR onto main (or something similar).

youknowone commented Feb 21, 2023 •
edited
Loading

Copy link
Copy Markdown
Member

Oh, this is done in #4232

Thanks @dannasman !

And thank you for contributing @nonzerofloat

youknowone closed this Feb 21, 2023
fn setstate(&self, state: PyTupleRef, vm: &VirtualMachine) -> PyResult<()> {
let args = state.as_slice();
if args.is_empty() {
let msg = String::from("function takes at leat 1 arguments (0 given)");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

leat should be least.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL