pep 525: We don't have a hard requirement for finalizers anymore
This commit is contained in:
parent
6b94a13802
commit
3e23210fe3
|
@ -215,13 +215,10 @@ problem, and everything just works.
|
||||||
generator is about to be GCed.
|
generator is about to be GCed.
|
||||||
|
|
||||||
When an asynchronous generator is iterated for the first time,
|
When an asynchronous generator is iterated for the first time,
|
||||||
it stores a reference to the current finalizer. If there is none,
|
it stores a reference to the current *finalizer*.
|
||||||
a ``RuntimeError`` is raised. This provides a strong guarantee that
|
|
||||||
every asynchronous generator object will always have a finalizer
|
|
||||||
installed by the correct event loop.
|
|
||||||
|
|
||||||
When an asynchronous generator is about to be garbage collected,
|
When an asynchronous generator is about to be garbage collected,
|
||||||
it calls its cached finalizer. The assumption is that the finalizer
|
it calls its cached *finalizer*. The assumption is that the finalizer
|
||||||
will schedule an ``aclose()`` call with the loop that was active
|
will schedule an ``aclose()`` call with the loop that was active
|
||||||
when the iteration started.
|
when the iteration started.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue