On Fri, Jun 16, 2023 at 4:20 AM Dom Grigonis <dom.grigo...@gmail.com> wrote:

> Just to add. I think same methods would be useful to have for strings as
> well.
>

strings are immutable, so `pop` is out.

As for `get` -- it *could* be added to the sequence ABC, but very much
doubt that will ever happen -- adding something to an ABC is very heavy
lift.

-CHB





> > On 14 Jun 2023, at 23:28, Dom Grigonis <dom.grigo...@gmail.com> wrote:
> >
> > Yes,
> > 1. adding keyword argument for `pop`
> > 2. implementing `get` method as it doesn’t exist at all
> >  * This wouldn’t break anything for sure. Well… theoretically could, but
> I find it hard to imagine anyone has written such code.
> >
> > I like PEP 463. Looks simple and intuitive.
> >
> >> On 14 Jun 2023, at 23:11, Chris Angelico <ros...@gmail.com> wrote:
> >>
> >> On Thu, 15 Jun 2023 at 06:04, Dom Grigonis <dom.grigo...@gmail.com>
> wrote:
> >>> So following Chris’ logic...
> >>> If there are 10,000,000 python users on Stack…
> >>> And we assume, that every user encounters such need at least 2 times a
> year (being very speculative here, would say conservative?).
> >>
> >> That was me being VERY generous to the other proposal :) At very best,
> >> what you're seeing is an *upper bound* on the number of people
> >> referenced, but I wasn't actually arguing numbers there so much as
> >> disputing the incredulity given.
> >>
> >> HOWEVER: Your proposal is much easier to make backward compatible.
> >> Adding a keyword-only parameter to a method that currently doesn't
> >> accept keyword arguments is (a) not going to conflict with current
> >> code, and (b) will instantly error out if someone attempts to use this
> >> feature on a Python that doesn't support it, so it's not going to
> >> cause subtle errors.
> >>
> >> Though, notably, this would count as another use-case for PEP 463, if
> >> anyone felt like reviving that.
> >>
> >> ChrisA
> >> _______________________________________________
> >> Python-ideas mailing list -- python-ideas@python.org
> >> To unsubscribe send an email to python-ideas-le...@python.org
> >> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> >> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/2S6ZFAMP5FBZKDCOSSSTXTU477WFTW2Z/
> >> Code of Conduct: http://python.org/psf/codeofconduct/
> >
>
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/ITFYOC4KKBGJ2VRFOOYM47DZWV66BUEJ/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/LYJNSGH6XW7RE7A5FEIX4PSYPPF4XO3O/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to