[Python-ideas] Re: Proposal: Python Native bindings for OpenAPI

2021-08-09 Thread Vaideeswaran Ganesan
Thanks Steve, This is very useful and actionable feedback. I'll work on the parallel examples. I'm pretty much sure, it might take few rounds of consultation to bring out the value. I will also seriously think through the PyPI as an approach, as I seem to feel that OpenAPI is not really "all that

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Samuel Freilich via Python-ideas
> that can be used (eg) for indexing Even without it being used in as complicated a way as that it's *still* not backward compatible because of the trivial case, as foo.endswith("") is True. On Sun, Aug 8, 2021 at 11:55 PM Chris Angelico wrote: > On Mon, Aug 9, 2021 at 1:42 PM wrote: > > > > T

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Chris Angelico
On Mon, Aug 9, 2021 at 10:32 PM Samuel Freilich wrote: > > > that can be used (eg) for indexing > > Even without it being used in as complicated a way as that it's still not > backward compatible because of the trivial case, as foo.endswith("") is True. > I was talking specifically about the ori

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Simão Afonso
On 2021-08-09 23:57:42, Chris Angelico wrote: > On Mon, Aug 9, 2021 at 10:32 PM Samuel Freilich wrote: > > Even without it being used in as complicated a way as that it's still not > > backward compatible because of the trivial case, as foo.endswith("") is > > True. > > I was talking specifical

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread fgallaire
Two possibilities: 1) the perfectly backward compatible, retrun False 2) the more pythonic, return the empty value of the object (i.e. "" for str) ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le...

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Chris Angelico
On Tue, Aug 10, 2021 at 12:03 AM Simão Afonso wrote: > > On 2021-08-09 23:57:42, Chris Angelico wrote: > > On Mon, Aug 9, 2021 at 10:32 PM Samuel Freilich > > wrote: > > > Even without it being used in as complicated a way as that it's still not > > > backward compatible because of the trivial

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Chris Angelico
On Tue, Aug 10, 2021 at 12:08 AM wrote: > > Two possibilities: > > 1) the perfectly backward compatible, retrun False > 2) the more pythonic, return the empty value of the object (i.e. "" for str) Please quote the person you're responding to, for context. Were you replying to Serhiy? ChrisA

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Serhiy Storchaka
09.08.21 17:05, [email protected] пише: > Two possibilities: > > 1) the perfectly backward compatible, retrun False > 2) the more pythonic, return the empty value of the object (i.e. "" for str) The problem is that for backward compatibility it should return True. And empty string's boolean val

[Python-ideas] Re: startswith() and endswith() methods returning the matched value

2021-08-09 Thread Samuel Freilich via Python-ideas
I was just saying that using the bool return value as an index is a bit obscure, compared to using it as a condition in an if statement. But even in the more common use, returning the matched string is still a chance in behavior. On Mon, Aug 9, 2021, 10:13 AM Chris Angelico wrote: > On Tue, Aug

[Python-ideas] Re: Pattern matching in python function headers

2021-08-09 Thread Steven D'Aprano
On Sun, Aug 08, 2021 at 11:30:20AM +0400, Abdulla Al Kathiri wrote: > For me, it looks normal because I am used to seeing pattern matching > for function parameters in functional programming languages. Can you give us a few samples from other languages? The only one I know is Haskell: fib