This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients alex, berker.peksag, brett.cannon, ezio.melotti, matrixise, serhiy.storchaka, vstinner
Date 2015-10-01.20:15:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I don't like this. The sys module is one of most used module, but it has too many members, and adding yet one makes the situation worse.

Hum, what is the problem of adding a symbol? How does it make the module less usable?

> Checking for debug mode is not often needed, and mainly in tests.

My patch changes distutils, sysconfig and warnings modules, I agree that other changes are only in tests.

>  Current way ``hasattr(sys, 'gettotalrefcount')`` works good.

For me it looks more like an hack than a reliable check.

> You also can check ``'d' in sys.abiflags`` if it looks cleaner to you.

For me, it doesn't look correct to have various ways to check if python was compiled in debug mode. It doesn't look portable neither. I prefer to use a flag which works on any version of Python (>= 3.6) and any implementation of Python.

I don't think that PyPy wants to implement sys.gettotalrefcount() for example, but PyPy may want to mimick CPython when it's compiled in debug mode. For example, display warnings by default in debug mode.
Date User Action Args
2015-10-01 20:15:05vstinnersetrecipients: + vstinner, brett.cannon, ezio.melotti, alex, berker.peksag, serhiy.storchaka, matrixise
2015-10-01 20:15:05vstinnersetmessageid: <>
2015-10-01 20:15:05vstinnerlinkissue25256 messages
2015-10-01 20:15:04vstinnercreate