[Python-ideas] Improve the textual representation of IPv4-mapped IPv6 addresses

2021-03-18 Thread Maxime Mouchet
Hi, Python supports IPv4-mapped IPv6 addresses as defined by RFC 4038: "the IPv6 address :::x.y.z.w represents the IPv4 address x.y.z.w.” The current behavior is as follows: from ipaddress import ip_address addr = ip_address(':::8.8.4.4') # IPv6Address(':::808:404') add

[Python-ideas] self documenting kwarg passing in functions similar to f-strings in python3.8

2021-03-18 Thread alexei . ciobanu
Hi all, Not sure if this feature already exists in python or if it has been proposed already but it would be extremely helpful for me and doesn't seem too difficult to implement. I often write functions with really long kwarg names that call other functions that share a kwarg name. What I curr

[Python-ideas] Re: self documenting kwarg passing in functions similar to f-strings in python3.8

2021-03-18 Thread Eric V. Smith
There was a long discussion about a year ago: https://mail.python.org/archives/list/[email protected]/thread/SIMIOC7OW6QKLJOTHJJVNNBDSXDE2SGV/#N2ZY5NQ5T2OJRSUGZJOANEQOGEQIYYIK Eric On 3/18/2021 12:28 AM, [email protected] wrote: Hi all, Not sure if this feature already exis

[Python-ideas] shouldn't slices be iterable ?

2021-03-18 Thread Cameron Simpson
I know that range(start,end,stride) will produce what I'd want from iter(slice(start,end,stride)), but wouldn't it be reasonable for a slice itself to be iterable? Yes, only one obvious way and all that, but inside eg __getitem__ it seems to me that: if isinstance(index, slice): fo

[Python-ideas] Re: shouldn't slices be iterable ?

2021-03-18 Thread Chris Angelico
On Fri, Mar 19, 2021 at 10:46 AM Cameron Simpson wrote: > > I know that range(start,end,stride) will produce what I'd want from > iter(slice(start,end,stride)), but wouldn't it be reasonable for a slice > itself to be iterable? > > Yes, only one obvious way and all that, but inside eg __getitem__

[Python-ideas] Re: shouldn't slices be iterable ?

2021-03-18 Thread Caleb Donovick
Or perhaps more problematic what happens if only stride is specified? On Thu, Mar 18, 2021 at 6:09 PM Chris Angelico wrote: > On Fri, Mar 19, 2021 at 10:46 AM Cameron Simpson wrote: > > > > I know that range(start,end,stride) will produce what I'd want from > > iter(slice(start,end,stride)), bu

[Python-ideas] Re: shouldn't slices be iterable ?

2021-03-18 Thread Cameron Simpson
I whinged: >> On Fri, Mar 19, 2021 at 10:46 AM Cameron Simpson wrote: >> > I know that range(start,end,stride) will produce what I'd want from >> > iter(slice(start,end,stride)), but wouldn't it be reasonable for a slice >> > itself to be iterable? [...] >On Thu, Mar 18, 2021 at 6:09 PM Chris Ang

[Python-ideas] Re: shouldn't slices be iterable ?

2021-03-18 Thread Chris Angelico
On Fri, Mar 19, 2021 at 3:18 PM Cameron Simpson wrote: > > I whinged: > >> On Fri, Mar 19, 2021 at 10:46 AM Cameron Simpson wrote: > >> > I know that range(start,end,stride) will produce what I'd want from > >> > iter(slice(start,end,stride)), but wouldn't it be reasonable for a slice > >> > itse