Re: [Python-Dev] why _PyGen_Finalize(gen) propagates close() to _PyGen_yf() ?

2017-04-03 Thread Oleg Nesterov
On 04/03, Stephen J. Turnbull wrote: > > Nathaniel Smith writes: > > > > Well, I'm afraid to contact this closed and not-for-mortals list, > > > not sure this very basic question should go there ;) perhaps you > > > are already a member, feel free to forward. > > > > core-mentorship is intende

Re: [Python-Dev] __del__ is not called after creating a new reference

2017-04-02 Thread Oleg Nesterov
On 04/02, Armin Rigo wrote: > > Hi all, > > On 20 March 2017 at 22:28, Nathaniel Smith wrote: > > Modern CPython, and all extant versions of PyPy and Jython, guarantee that > > __del__ is called at most once. > > Just a note, if someone actually depends on this: it is not true in > all cases. For

Re: [Python-Dev] why _PyGen_Finalize(gen) propagates close() to _PyGen_yf() ?

2017-03-30 Thread Oleg Nesterov
On 03/28, Eric Snow wrote: > > On Mon, Mar 20, 2017 at 11:30 AM, Oleg Nesterov wrote: > > Hello, > > > > Let me first clarify, I do not claim this is a bug, I am trying to learn > > python and now I trying to understand yield-from. > > Given that you haven

Re: [Python-Dev] __del__ is not called after creating a new reference

2017-03-21 Thread Oleg Nesterov
On 03/20, Nathaniel Smith wrote: > > Modern CPython, and all extant versions of PyPy and Jython, guarantee that > __del__ is called at most once. MicroPython doesn't support user-defined > __del__ methods. > > It's fine if the text wants to leave that open, but the current phrasing is > pretty misl

[Python-Dev] why _PyGen_Finalize(gen) propagates close() to _PyGen_yf() ?

2017-03-20 Thread Oleg Nesterov
Hello, Let me first clarify, I do not claim this is a bug, I am trying to learn python and now I trying to understand yield-from. This simple test-case g = (x for x in range(10)) def fg(): for x in g: yield x print(next(fg()))

[Python-Dev] __del__ is not called after creating a new reference

2017-03-20 Thread Oleg Nesterov
Hello, I already tried to ask on python-list, see https://mail.python.org/pipermail/python-list/2017-March/720037.html but it seems that this list is not for technical questions. Let me resend my question to python-dev. Please tell me if I should not spam this list with newbiesh questions, and th