Message280193
To take a decision, I would suggest to implement the warning, run the
Python test suite, and run the test suite of a few applications like
Twisted and Django, to see how much code needs to be modified.
Well, let's say that my code consumes a generator but emits the
warning because it doesn't consume completely the warning. What am I
supposed to do?
Let's say the the generator is an infine suite like (2**i for i in
itertools.count()). Should I call gen.close()?
If a generator holds a resource like a file, does gen.close()
immediately release the resource? Or does it rely on the garbage
collector?
I'm curious to see if using source=frame when emitting the warning
helps to identify quickly the origin of the bug. I added the source
parameter in Python 3.6. It requires the usage of tracemalloc to log
where the source object (the frame in this case) was allocated. |
|
Date |
User |
Action |
Args |
2016-11-07 08:56:04 | vstinner | set | recipients:
+ vstinner, ncoghlan, njs, yselivanov |
2016-11-07 08:56:04 | vstinner | link | issue28629 messages |
2016-11-07 08:56:04 | vstinner | create | |
|