> On 20 Mar 2021, at 04:39, Guido van Rossum <gu...@python.org> wrote: > > Honestly this is an example of a module that would have been better off > outside the stdlib. > > On Fri, Mar 19, 2021 at 14:43 Senthil Kumaran <sent...@python.org> wrote: > On Mon, Feb 15, 2021 at 8:36 AM Faisal Mahmood > <fasial.mahmoo...@gmail.com> wrote: > > > > Hello, > > > > I hope you are all well, I currently have an issue / merge request that has > > become stale and as per the guidelines I am sending this e-mail to request > > someone to review it for me please. > > > > Issue Number: 42861 (https://bugs.python.org/issue42861) > > Pull Request: 24180 (https://github.com/python/cpython/pull/24180) > > > > Could you share some motivation references that could help explain why > this next_network method will be helpful? Is this common enough to > warrant a method in the stdlib IP-Address module? > If there is prior-art in other external libraries or libraries of > other languages, that will be helpful to know and review too. > > I had looked at this a month ago when you pinged for review, but I > could not immediately determine the benefit of having this method in > stdlib, irrespective of implementation correctness or API Signature. > I also lack extensive experience with ipv6. > > Thanks, > Senthil
I don’t know if this is gonna support Faisal’s cause (“It’s used in a third party library in the wild, that means stdlib could use it!”) or the exact opposite (“it’s provided by a third party library, so may as well use third party library and stdlib doesn’t necessarily need this”) but the quite popular netaddr library that I’m a maintainer of does have IPNetwork.next() and IPNetwork.previous() methods[1][2]. The main difference is that in netaddr: * next() and previous() can produce networks arbitrary number of steps away, not just the first closest network forwards or backwards * going from a network to its supernetwork or subnetwork is done through a separate set of supernet() and subnet() methods[3][4] I can’t say how many library users actually consume this particular section of the API, of course, but I expect this API to be used and it seems rather useful. Best, Jakub [1] https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPNetwork.next [2] https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPNetwork.previous [3] https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPNetwork.subnet [4] https://netaddr.readthedocs.io/en/latest/api.html#netaddr.IPNetwork.supernet _______________________________________________ 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 https://mail.python.org/archives/list/python-dev@python.org/message/NN2OTO7Z4326CL5T3SLJQDZBRKZXOIPG/ Code of Conduct: http://python.org/psf/codeofconduct/