Re: [Python-Dev] checking "errno" for math operaton is safe to determine the error status?

2019-04-11 Thread Greg Ewing
Xin, Peixing wrote: On certain platform, expm1() is implemented as exp() minus 1. To calculate expm1(-1420.0), that will call exp(-1420.0) then substract 1. You know, exp(-1420.0) will underflow to zero and errno is set to ERANGE. As a consequence the errno keeps set there when expm1() returns th

Re: [Python-Dev] checking "errno" for math operaton is safe to determine the error status?

2019-04-11 Thread Xin, Peixing
Thanks for your explanation, Christian. Actually my question is not about thread safe or the original value 0 on errno. Probably I didn't express the point clearly. To be more clear, let me take expm1 as an example below. On certain platform, expm1() is implemented as exp() minus 1. To calculate

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-11 Thread Nathaniel Smith
On Thu, Apr 11, 2019 at 8:32 AM Serhiy Storchaka wrote: > On other hand, since using the debug allocator doesn't cause problems > with compatibility, it may be possible to use similar technique for the > objects double list. Although this is not easy because of objects placed > at static memory.

Re: [Python-Dev] PEP 590 discussion

2019-04-11 Thread Brett Cannon
On Thu, Apr 11, 2019 at 5:06 AM Jeroen Demeyer wrote: > Petr, > > I realize that you are in a difficult position. You'll end up > disappointing either me or Mark... > > I don't know if the steering council or somebody else has a good idea to > deal with this situation. > Our answer was "ask Petr

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-11 Thread Serhiy Storchaka
11.04.19 12:28, Victor Stinner пише: Le jeu. 11 avr. 2019 à 07:49, Serhiy Storchaka a écrit : 10.04.19 14:01, Victor Stinner пише: Disabling Py_TRACE_REFS by default in debug mode reduces the Python memory footprint. Py_TRACE_REFS costs 2 pointers per PyObject: 16 bytes on 64-bit platforms.

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-11 Thread Steve Dower
On 10Apr2019 1917, Nathaniel Smith wrote: It sounds like --with-pydebug has accumulated a big grab bag of unrelated features, mostly stuff that was useful at some point for some CPython dev trying to debug CPython itself? It's clearly not designed with end users as the primary audience, given tha

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-11 Thread Steve Dower
On 11Apr2019 0228, Victor Stinner wrote: Le jeu. 11 avr. 2019 à 07:49, Serhiy Storchaka a écrit : 10.04.19 14:01, Victor Stinner пише: Disabling Py_TRACE_REFS by default in debug mode reduces the Python memory footprint. Py_TRACE_REFS costs 2 pointers per PyObject: 16 bytes on 64-bit platforms

Re: [Python-Dev] checking "errno" for math operaton is safe to determine the error status?

2019-04-11 Thread Christian Heimes
On 11/04/2019 11.45, Xin, Peixing wrote: > Hi, Math experts: > > Looking at the codes below, for many math operations, CPython is checking > errno to determine the error status even though the math function returns > normal value back. Is it a safe solution? From the description here > http://m

Re: [Python-Dev] PEP 590 discussion

2019-04-11 Thread Jeroen Demeyer
Petr, I realize that you are in a difficult position. You'll end up disappointing either me or Mark... I don't know if the steering council or somebody else has a good idea to deal with this situation. Jeroen has time Speaking of time, maybe I should clarify that I have time until the en

Re: [Python-Dev] PEP 590 discussion

2019-04-11 Thread Petr Viktorin
On 4/11/19 1:05 AM, Jeroen Demeyer wrote: On 2019-04-10 18:25, Petr Viktorin wrote: Hello! I've had time for a more thorough reading of PEP 590 and the reference implementation. Thank you for the work! And thank you for the review! One general note: I am not (yet) choosing between PEP 580 an

[Python-Dev] checking "errno" for math operaton is safe to determine the error status?

2019-04-11 Thread Xin, Peixing
Hi, Math experts: Looking at the codes below, for many math operations, CPython is checking errno to determine the error status even though the math function returns normal value back. Is it a safe solution? From the description here http://man7.org/linux/man-pages/man3/errno.3.html and https:

Re: [Python-Dev] No longer enable Py_TRACE_REFS by default in debug build

2019-04-11 Thread Victor Stinner
Le jeu. 11 avr. 2019 à 07:49, Serhiy Storchaka a écrit : > 10.04.19 14:01, Victor Stinner пише: > > Disabling Py_TRACE_REFS by default in debug mode reduces the Python > > memory footprint. Py_TRACE_REFS costs 2 pointers per PyObject: 16 > > bytes on 64-bit platforms. > > Does not the memory alloc