[Python-ideas] Re: Add a replace method to tuples

2022-03-16 Thread Stephen J. Turnbull
MRAB writes: > I'm wondering whether an alterative could be a function for splicing > sequences such as lists and tuples which would avoid the need to create > and then destroy intermediate sequences: > > splice(alist, i, 1 + 1, [value]) Does this make sense for lists? I don't see

[Python-ideas] Re: Expand type coverage in cpython implementation

2022-03-16 Thread Eric Fahlgren
Most importantly, static type checking is still immature and as yet there is no standard for how to say "this thing is an X". Adding type hints into the stdlib source would force you to choose one (third party) tool, https://typing.readthedocs.io/en/latest/#type-checkers , which then would lock

[Python-ideas] Re: Add a replace method to tuples

2022-03-16 Thread Chris Angelico
On Thu, 17 Mar 2022 at 01:09, Stephen J. Turnbull wrote: > > Steven D'Aprano writes: > > > You can try putting an enhancement request on the bug tracker, > > almost certainly you will be told to propose it here to see if > > there is consensus that it is useful enough. You can submit a PR >

[Python-ideas] Re: Add a replace method to tuples

2022-03-16 Thread Stephen J. Turnbull
Steven D'Aprano writes: > You can try putting an enhancement request on the bug tracker, > almost certainly you will be told to propose it here to see if > there is consensus that it is useful enough. You can submit a PR > on the repo, but likewise. You can ask on Python-Dev, but you will >

[Python-ideas] Re: Expand type coverage in cpython implementation

2022-03-16 Thread Jelle Zijlstra
El mié, 16 mar 2022 a las 3:58, Jared Crawford () escribió: > Hi all, > > I recently noticed that stdlib functions often don't have type hints. Is > there a technical reason why typing isn't more widespread in the cpython > implementation? Mostly there hasn't been agreement to add them. See

[Python-ideas] Expand type coverage in cpython implementation

2022-03-16 Thread Jared Crawford
Hi all, I recently noticed that stdlib functions often don't have type hints. Is there a technical reason why typing isn't more widespread in the cpython implementation? As a developer, it'd be great if I didn't have to wrap many of my stdlib calls in casts to make mypy happy. Please let me