[Python-Dev] Re: PEP 651 -- Robust Overflow Handling

2021-01-19 Thread Sebastian Berg
On Tue, 2021-01-19 at 13:31 +, Mark Shannon wrote: > Hi everyone, > > It's time for yet another PEP :) > > Fortunately, this one is a small one that doesn't change much. > It's aim is to make the VM more robust. > > Abstract > > > This PEP proposes that machine stack overflow is tr

[Python-Dev] Re: PEP 651 -- Robust Overflow Handling

2021-01-19 Thread Sebastian Berg
On Tue, 2021-01-19 at 16:22 +, Mark Shannon wrote: > > > On 19/01/2021 3:43 pm, Sebastian Berg wrote: > > On Tue, 2021-01-19 at 13:31 +, Mark Shannon wrote: > > > Hi everyone, > > > > > > It's time for yet another PEP :) > > >

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread Sebastian Berg
On Thu, 2021-05-20 at 19:00 +0100, Paul Moore wrote: > On Thu, 20 May 2021 at 18:13, Luciano Ramalho > wrote: > > > > I'd like to learn about use cases where `...` (a.k.a. `Ellipsis`) > > is > > not a good sentinel. It's a pickable singleton testable with `is`, > > readily available, and extremel

[Python-Dev] Re: PEP 674: Disallow using macros as l-value

2021-12-07 Thread Sebastian Berg
On Tue, 2021-12-07 at 13:54 -0300, Joao S. O. Bueno wrote: > Sorry for stepping in - but I am seeing too many arguments in favour > of the rules because "they are the rules", and just Victor arguing > with > what is met in the "real world". > > But if this update can be done by a simple search/rep

[Python-Dev] Re: Python 3.10 vs 3.8 performance degradation

2021-12-19 Thread Sebastian Berg
On Sun, 2021-12-19 at 18:48 +, Tigran Aivazian wrote: > To eliminate the possibility of being affected by the different > versions of numpy I have just now upgraded numpy in Python 3.8 > environment to the latest version, so both 3.8 and 3.10 and using > numpy 1.21.4 and still the timing is exa

[Python-Dev] Re: Moving away from _Py_IDENTIFIER().

2022-02-04 Thread Sebastian Berg
On Thu, 2022-02-03 at 15:32 +0100, Victor Stinner wrote: > By the way, Argument Clinic now produces way faster calling > conventions than hand-written METH_VARARGS with PyArg_ParseTuple(). > It > would be make this tool available to 3rd party projects. > > Either extract it and put it on PyPI, but

[Python-Dev] Re: PEP 683: "Immortal Objects, Using a Fixed Refcount" (round 2)

2022-02-23 Thread Sebastian Berg
On Thu, 2022-02-24 at 00:21 +0100, Antonio Cuni wrote: > On Mon, Feb 21, 2022 at 5:18 PM Petr Viktorin > wrote: > > Should we care about hacks/optimizations that rely on having the only > > reference (or all references), e.g. mutating a tuple if it has > > refcount > > 1? Immortal objects shouldn

[Python-Dev] Re: C API: Move PEP 523 "Adding a frame evaluation API to CPython" private C API to the internal C API

2022-03-30 Thread Sebastian Berg
On Wed, 2022-03-30 at 17:51 +0200, Petr Viktorin wrote: > On 30. 03. 22 17:42, Guido van Rossum wrote: > > In the not so distant past I have proposed to introduce a new > > category, > > "Unstable APIs". These are public but are not guaranteed to be > > backwards > > compatible in feature release

[Python-Dev] Re: Are PyObject_RichCompareBool shortcuts part of Python or just CPython quirks?

2020-01-23 Thread Sebastian Berg
On Thu, 2020-01-23 at 18:36 -0800, Guido van Rossum wrote: > Good question! > It is, below mostly lamenting, so just to say my personal gut feeling would be that it should probably be considered an "implementation detail" that this used e.g. by most containers. But besides that it leads to unexpe

[Python-Dev] Limited API, MetaClasses, and ExtensionMetaClasses

2020-01-31 Thread Sebastian Berg
Hi all, I may be thinking in the wrong direction, but right now `PyType_Type.tp_new` will resolves the `metaclass` from the bases and call: type = (PyTypeObject *)metatype->tp_alloc(metatype, nslots); where `metatype` is actually resolved from the metatype of the bases. In contrast `PyType_

[Python-Dev] Re: Are PyObject_RichCompareBool shortcuts part of Python or just CPython quirks?

2020-02-03 Thread Sebastian Berg
Now, probably this has been rejected a hundred times before, and there are some very good reason why it is a horrible thought... But if `PyObject_RichCompareBool(..., Py_EQ)` is such a fundamental operation (and in a sense it seems to me that it is), is there a point in explicitly defining it? Th

[Python-Dev] Re: Are PyObject_RichCompareBool shortcuts part of Python or just CPython quirks?

2020-02-03 Thread Sebastian Berg
On Mon, 2020-02-03 at 16:43 -0800, Larry Hastings wrote: > On 2/3/20 3:07 PM, Sebastian Berg wrote: > > That would mean adding `operator.equivalent(a, b) -> bool` which > > would > > allow float to override the result and let > > `operator.equivalent_value(float(&qu

[Python-Dev] Re: Are PyObject_RichCompareBool shortcuts part of Python or just CPython quirks?

2020-02-03 Thread Sebastian Berg
On Tue, 2020-02-04 at 13:44 +1100, Steven D'Aprano wrote: > On Mon, Feb 03, 2020 at 05:26:38PM -0800, Sebastian Berg wrote: > > If you want to argue that "identical or equal" is such a fundamental > and > important operation in Python code that we ought to of

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-21 Thread Sebastian Berg
On Tue, 2020-04-21 at 16:21 +0200, Victor Stinner wrote: > Le mar. 21 avr. 2020 à 00:50, Nathaniel Smith a écrit > : > > > > tl;dr: accepting PEP 554 is effectively a C API break, and will > > force > > many thousands of people worldwide to spend many hours wrangling > > with > > subinterpreter

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-21 Thread Sebastian Berg
On Tue, 2020-04-21 at 11:21 -0500, Sebastian Berg wrote: > On Tue, 2020-04-21 at 16:21 +0200, Victor Stinner wrote: > > Le mar. 21 avr. 2020 à 00:50, Nathaniel Smith a > > écrit > > : > > As far as I can tell, nobody can or _should_ expect subinterpreters > to >

[Python-Dev] Re: PEP 554 for 3.9 or 3.10?

2020-04-29 Thread Sebastian Berg
On Tue, 2020-04-28 at 19:20 -0600, Eric Snow wrote: > On Tue, Apr 21, 2020 at 11:17 AM Sebastian Berg > wrote: > > Maybe one of the frustrating points about this criticism is that it > > does not belong in this PEP. And that is actually true! I > > wholeheartedly agre

[Python-Dev] Re: Detect memory leaks in unit tests

2020-05-13 Thread Sebastian Berg
On Wed, 2020-05-13 at 13:14 +0100, Pablo Galindo Salgado wrote: > > But again this is for PyObjects only. > > Not really, we check also memory blocks: > > https://github.com/python/cpython/blob/master/Lib/test/libregrtest/refleak.py#L72 > > as long as you don't directly call malloc and use one o