[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-13 Thread Chris Angelico
On Thu, 14 Apr 2022 at 08:47, Greg Ewing wrote: > > On 13/04/22 8:29 am, Steven D'Aprano wrote: > >> When multiple parent provide candidate to a method resolution, raise an > >> error. > > > > Then you aren't doing full MI any more, > > That sounds like a "true Scotsman" argument. Who defines

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-13 Thread Greg Ewing
On 13/04/22 8:29 am, Steven D'Aprano wrote: When multiple parent provide candidate to a method resolution, raise an error. Then you aren't doing full MI any more, That sounds like a "true Scotsman" argument. Who defines what "full MI" means? I can think of at least two languages that do

[Python-ideas] Re: heapq max heap

2022-04-13 Thread Nick Timkovich
I myself have proposed heap objects and seen that and other features come up from time to time. I think the general mood is to use a PyPI library, or even just vendor a single file from a package like xheap https://github.com/srkunze/xheap/blob/master/xheap.py If you wanted to stick with what's

[Python-ideas] heapq max heap

2022-04-13 Thread Eduardo Nery
Many times when using the heapq lib I had to convert my array to negative values so that it could behave like a max heap. Maybe we should pass in a parameter in the functions to specify if we want a max heap behaviour or a min heap behaviour. ___

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-13 Thread Eric V. Smith
On 4/13/2022 7:22 AM, malmiteria wrote: Eric V. Smith writes: My suggestion is to rework your proposal to not break any existing code I've been doing that already, and i'll keep doing it, i'm very aware of this constraint. What are the biggest breaking change i haven't covered yet, in your

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-13 Thread Chris Angelico
On Wed, 13 Apr 2022 at 21:24, malmiteria wrote: > > Chris Angelico writes: > > A proposal that breaks existing code, and which introduces a new way > > to do things, will usually require multiple versions of deprecation > > time in order to be accepted. > Nothing is preventing us from doing that

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-13 Thread malmiteria
Chris Angelico writes: > A proposal that breaks existing code, and which introduces a new way > to do things, will usually require multiple versions of deprecation > time in order to be accepted. Nothing is preventing us from doing that here. I already intend to have the adoption syntax come

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-13 Thread Antoine Rozo
> And, on top of that, the actual change needed to switch from today's solution to adoption is extremly simple. > replace > ``` > class A(B,C): ... > ``` > with > ``` > class A(B(C)): ... > ``` > That's it. `class A(B(C))` is already a valid Python syntax (for example you could use `class