[issue34608] gc.get_referrers behavior change 3.6 to 3.7

2018-09-09 Thread INADA Naoki


INADA Naoki  added the comment:

Benjamin is right.
This is very implementation detail.  We shouldn't rely on such edge case.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34608] gc.get_referrers behavior change 3.6 to 3.7

2018-09-08 Thread Xiang Zhang


Change by Xiang Zhang :


--
nosy: +inada.naoki, pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34608] gc.get_referrers behavior change 3.6 to 3.7

2018-09-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Likely fallout from 5a625d0aa6a6d9ec6574ee8344b41d63dcb9897e.

get_referrers() doesn't really guarantee anything. It's more of a clever hack 
based on however the Python GC works at the moment. So, this it probably 
WONTFIX.

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34608] gc.get_referrers behavior change 3.6 to 3.7

2018-09-07 Thread Bryan

New submission from Bryan :

When called on a local object inside a function, gc.get_referrers no longer 
returns a Frame as one of the references. I could not find anything in the 
release notes or changeling that indicated that this is an intentional change. 

The following script generates different output when run on Python 3.6 vs 
Python 3.7 (on linux, OSX, or Windows):

```
# referrers.py
import gc, sys

class FakeMod(object): pass

extra = []

def test():
mod = FakeMod()
extra.append(mod)
referrers = gc.get_referrers(mod)
print(".".join(str(x) for x in sys.version_info[:3]), ":", len(referrers), 
referrers)

test()
```

Output:

~ master*
(py37) ❯ python test.py
3.7.0 : 1 [[<__main__.FakeMod object at 0x10b65e320>]]

~ master*
(base) ❯ python test.py
3.6.6 : 2 [[<__main__.FakeMod object at 0x106f3ea90>], ]

--
components: Library (Lib)
messages: 324771
nosy: bryevdv
priority: normal
severity: normal
status: open
title: gc.get_referrers behavior change 3.6 to 3.7
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com