Ivan Levkivskyi added the comment:

> BTW, if I set maxsize=100000 for typing lru_cache, test_generic_forward_ref 
> crashes in refleak-test mode. Maybe this is another bug...

This one is also related to the mentioned in my previous message. Namely, 
forward references are only evaluated once. However, in refleak hunting mode 
tests are repeated multiple times, and every time test_generic_forward_ref is 
called, this code:

    class CC: ...

creates a new local class, while forward ref is still pointing to an old one.

There are two options:
* keep this behaviour and update the test to use a globally defined class;
* change this and re-evaluate forward refs every times.

However I would vote for a compromise solution: if the ``locals`` argument is 
not given, just use the evaluated value. But if a user gives non-None 
``locals`` argument then that user most probably wants to re-evaluate the 
forward ref locally.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to