-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-41270: Making NamedTemporaryFile act as its own iterator to mimic… #22766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… normal file objects. NamedTemporaryFile returns a proxy object _TemporaryFileWrapper. However it does not proxy the __next__ method so the object cannot be used by for loops or by the next() builtin without calling iter() on it first. This changes that by explicity poxying the __next__ method.
jstasiak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
|
@jstasiak this has been sitting for a while. Is there any update? |
|
@xzy3 I'm dorry, I'm not a core dev, I can't do anything other than reviewing this. |
|
Following the issue migration to GitHub, this PR would close #85442. |
… normal file objects.
NamedTemporaryFilereturns a proxy object_TemporaryFileWrapper. However it does not proxythe
__next__method so the object cannot be used by for loops or by thenext()builtinwithout calling
iter()on it first. This changes that by explicitly poxying the__next__method.
https://bugs.python.org/issue41270