[Python-ideas] Convergence of bytes and str APIs [was: Custom string prefixes]

2019-09-02 Thread Stephen J. Turnbull
Chris Angelico writes: > Older versions of Python had text and bytes be the same things. That > means that, for backward compatibility, they have some common methods. > But does that really mean that bytes can be uppercased? Or is it that > we allow bytes to be treated as ASCII-encoded text, w

[Python-ideas] Re: Custom string prefixes

2019-09-02 Thread Ivan Levkivskyi
On Mon, 2 Sep 2019 at 07:04, Pasha Stetsenko wrote: > > Don't say that this proposal won't be abused. Every one of the OP's > > motivating examples is an abuse of the syntax, returning non-strings > > from something that looks like a string. > > If you strongly believe that if something looks lik

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-02 Thread Ivan Levkivskyi
On Thu, 29 Aug 2019 at 23:48, Guido van Rossum wrote: > On Thu, Aug 29, 2019 at 3:33 PM Chris Angelico wrote: > >> On Fri, Aug 30, 2019 at 8:28 AM Guido van Rossum >> wrote: > > [...] > > > I do tink we should probably review PEP 585 before doing anything about > unions specifically -- likely t

[Python-ideas] Re: Custom string prefixes

2019-09-02 Thread Steven D'Aprano
On Sun, Sep 01, 2019 at 12:24:24PM +1000, Chris Angelico wrote: > Older versions of Python had text and bytes be the same things. Whether a string object is *text* is a semantic question, and independent of what data format you use. 'Hello world!' is text, whether you are using Python 1.5 or Py

[Python-ideas] Re: Custom string prefixes

2019-09-02 Thread Chris Angelico
On Mon, Sep 2, 2019 at 9:56 PM Steven D'Aprano wrote: > > On Sun, Sep 01, 2019 at 12:24:24PM +1000, Chris Angelico wrote: > > > Older versions of Python had text and bytes be the same things. > > Whether a string object is *text* is a semantic question, and > independent of what data format you us