[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Steven D'Aprano
On Thu, Nov 11, 2021 at 11:01:32AM -0800, Richard Levasseur wrote: > Should the stdlib have e.g. SortedList? Probably not, because the use cases > of such data types are too niche to a one-size-fits-all implementation, and > there are too many implementations with too many of their own settings.

[Python-Dev] Re: Adding pep-8-casing-compliant aliases for unittest and logging

2021-11-11 Thread Ethan Furman
Woops, wrong list -- please disregard. -- ~Ethan~ ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at

[Python-Dev] Adding pep-8-casing-compliant aliases for unittest and logging

2021-11-11 Thread Ethan Furman
On 11/11/21 11:53 AM, Matt del Valle wrote: > Okay, so from the replies so far it looks like this is very quickly going into the 'never gonna happen' > dumpster, so in the interests of salvaging *something* out of it: [...] > I just dislike having to settle for 'it's what we've got'. With

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Richard Levasseur
On Thu, Nov 11, 2021 at 11:22 AM Antoine Pitrou wrote: > On Thu, 11 Nov 2021 11:01:32 -0800 > Richard Levasseur wrote: > > > > In the end, it was a fun exercise, but in practice a dictionary and > > sorted() got me 90% of the way there and sufficed. Optimizing that last > 10% > > wasn't worth

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Tim Peters
[Christopher Barker ] > Earlier in the thread, we were pointed to multiple implementations. > > Is this particular one clearly the “best”[*]? > > If so, then sure. > > -CHB > > [*] best meaning “most appropriate for the stdlib”. A couple folks have > already pointed to the quality of the code. But

[Python-Dev] Re: containment and the empty container

2021-11-11 Thread Ethan Furman
On 11/9/21 9:02 AM, Guido van Rossum wrote: > On Mon, Nov 8, 2021 at 10:29 PM Ethan Furman wrote: >> The way I see it, the following should hold >> >> empty_flag = RegexFlag(0) >> any_case = RegexFlag.IGNORECASE >> any_case_on_any_line = RegexFlag.IGNORECASE |

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Antoine Pitrou
On Thu, 11 Nov 2021 12:39:50 + Bob Fang wrote: > > But if anyone wants to argue the "the stdlib should be shrinking, not > > growing" position, I suggest they do so *before* someone reaches out > > to the module author. No point in us making the suggestion and then > > being forced to

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Antoine Pitrou
On Thu, 11 Nov 2021 20:58:29 + Bob Fang wrote: > Just want to mention that we do have this nice website to look at, although I > am not sure how up to date it is: > > https://www.wheelodex.org/projects/sortedcontainers/rdepends/?page=1 Wow, thank you, that is very nice! Best regards

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Bob Fang
Just want to mention that we do have this nice website to look at, although I am not sure how up to date it is: https://www.wheelodex.org/projects/sortedcontainers/rdepends/?page=1 > On 11 Nov 2021, at 19:20, Antoine Pitrou wrote: > > Unfortunately, PyPI doesn't seem to offer a way to query

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Alex Waygood
I'll join Christopher Barker and Chris Angelico in voicing scepticism -- personally, I feel like I'm yet to be persuaded that the use case is strong enough. sortedcontainers is a wonderful package, and I would completely support a prominent link to the library in the Python documentation. But the

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Bob Fang
> But if anyone wants to argue the "the stdlib should be shrinking, not > growing" position, I suggest they do so *before* someone reaches out > to the module author. No point in us making the suggestion and then > being forced to withdraw it. So I suppose we can take a poll on this? If majority

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Andrew Svetlov
sortedcontainers looks great! I very much appreciate it if such well-done library have type hints (embedded or at least in form of types-sortedcontainers pypi package). >From my experience of multidict library support, it is not a super-hard challenge but something that needs attention and time

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Antoine Pitrou
On Thu, 11 Nov 2021 11:01:32 -0800 Richard Levasseur wrote: > > In the end, it was a fun exercise, but in practice a dictionary and > sorted() got me 90% of the way there and sufficed. Optimizing that last 10% > wasn't worth the effort. > > Anyways, I came to two particular, IMHO, conclusions:

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Richard Levasseur
On Thu, Nov 11, 2021 at 4:30 AM Paul Moore wrote: > On Thu, 11 Nov 2021 at 11:51, Antoine Pitrou wrote: > > > > On Wed, 10 Nov 2021 21:12:17 -0600 > > Tim Peters wrote: > > > [Bob Fang ] > > > > This is a modest proposal to consider having sorted containers > > > >

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Daniel Pope
Serhiy Storchaka wrote: > From my C++ and Java experience, hashtable-based containers are much > more useful than tree-based containers. They are more compact and fast. > In most cases the only reason of using sorted container is supporting > deterministic iteration order, but often it is enough

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Christopher Barker
Earlier in the thread, we were pointed to multiple implementations. Is this particular one clearly the “best”[*]? If so, then sure. -CHB [*] best meaning “most appropriate for the stdlib”. A couple folks have already pointed to the quality of the code. But my understanding is that different

[Python-Dev] Re: Remove asyncore, asynchat and smtpd modules

2021-11-11 Thread Guido van Rossum
Yes please. Long overdue. On Thu, Nov 11, 2021 at 4:38 AM Victor Stinner wrote: > Hi, > > The asyncore module is a very old module of the Python stdlib for > asynchronous programming, usually to handle network sockets > concurrently. It's a common event loop, but its design has many flaws. > >

[Python-Dev] Remove asyncore, asynchat and smtpd modules

2021-11-11 Thread Victor Stinner
Hi, The asyncore module is a very old module of the Python stdlib for asynchronous programming, usually to handle network sockets concurrently. It's a common event loop, but its design has many flaws. The asyncio module was added to Python 3.4 with a well designed architecture. Twisted

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Paul Moore
On Thu, 11 Nov 2021 at 11:51, Antoine Pitrou wrote: > > On Wed, 10 Nov 2021 21:12:17 -0600 > Tim Peters wrote: > > [Bob Fang ] > > > This is a modest proposal to consider having sorted containers > > > (http://www.grantjenks.com/docs/sortedcontainers/) in standard library. > > > > +1 from me,

[Python-Dev] Re: Having Sorted Containers in stdlib?

2021-11-11 Thread Antoine Pitrou
On Wed, 10 Nov 2021 21:12:17 -0600 Tim Peters wrote: > [Bob Fang ] > > This is a modest proposal to consider having sorted containers > > (http://www.grantjenks.com/docs/sortedcontainers/) in standard library. > > +1 from me, but if and only if Grant Jenks (its author) wants that too. > >