STINNER Victor <victor.stin...@gmail.com> added the comment:

I wrote PR 3910 to modify COUNT_ALLOCS: alllcations statistics are now written 
into stderr, rather than stdout.

The PR contains also changes to fix tests with COUNT_ALLOCS. I'm not sure about 
this part of the PR. I would prefer to not dump statistics by default, and add 
a new option to enable it.

I don't know if we can easily implement "-X showalloccount", since Python 2.7 
doesn't have sys._xoptions. Maybe we could use a new environment variable 
instead: PYTHONSHOWALLOCCOUNT=1?

I would prefer to add a new option instead of having to patch so many unit 
tests:

haypo@selma$ git diff 2.7.. --stat
 Lib/json/tests/test_tool.py                                                 |  
8 ++++++--
 Lib/test/support/__init__.py                                                |  
3 +++
 Lib/test/test_abc.py                                                        |  
2 ++
 Lib/test/test_gc.py                                                         |  
4 +++-
 Lib/test/test_hash.py                                                       |  
2 +-
 Lib/test/test_module.py                                                     |  
3 ++-
 Lib/test/test_multiprocessing.py                                            |  
4 +++-
 Lib/test/test_regrtest.py                                                   |  
1 +
 Lib/test/test_subprocess.py                                                 | 
17 +++++++++++++++++
 Lib/test/test_sys.py                                                        | 
21 +++++++++++++++------
 Lib/test/test_threading.py                                                  | 
11 ++++++++---
 Lib/test/test_tools.py                                                      | 
10 +++++++---
 Lib/test/test_warnings.py                                                   |  
4 ++++
 Lib/test/test_weakref.py                                                    |  
1 +
 Misc/NEWS.d/next/Core and Builtins/2017-10-06-21-56-47.bpo-31692.osJuVJ.rst |  
2 ++
 Python/pythonrun.c                                                          |  
2 +-
 16 files changed, 76 insertions(+), 19 deletions(-)

----------

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

Reply via email to