[Python-Dev] Re: enum in the stable ABI (Was: PEP 558: Defined semantics for locals)

2021-07-27 Thread Petr Viktorin
On 24. 07. 21 1:58, Nick Coghlan wrote: On Sat, 24 Jul 2021, 9:37 am Larry Hastings, > wrote: On 7/23/21 7:38 AM, Petr Viktorin wrote: (In both C & C++, the size of an `enum` is implementation-defined. That's unlikely to be a problem in practice,

[Python-Dev] Re: enum in the stable ABI (Was: PEP 558: Defined semantics for locals)

2021-07-23 Thread Devin Jeanpierre
On Fri, Jul 23, 2021 at 7:40 AM Petr Viktorin wrote: [snip] > On 21. 07. 21 14:18, Nick Coghlan wrote: > [snip] > > Please don't put the enum in the stable ABI. If we would add another > > value and then an older extension would receive it, we'd get > undefined > > behavior. > >

[Python-Dev] Re: enum in the stable ABI (Was: PEP 558: Defined semantics for locals)

2021-07-23 Thread Nick Coghlan
On Sat, 24 Jul 2021, 9:37 am Larry Hastings, wrote: > > On 7/23/21 7:38 AM, Petr Viktorin wrote: > > (In both C & C++, the size of an `enum` is implementation-defined. That's > unlikely to be a problem in practice, but one more point against enum.) > > > True, but there's always the old trick of

[Python-Dev] Re: enum in the stable ABI (Was: PEP 558: Defined semantics for locals)

2021-07-23 Thread Larry Hastings
On 7/23/21 7:38 AM, Petr Viktorin wrote: (In both C & C++, the size of an `enum` is implementation-defined. That's unlikely to be a problem in practice, but one more point against enum.) True, but there's always the old trick of sticking in a value that forces it to be at least 32-bit: