Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Guido van Rossum
But to the OP, this is not considered a bug. On Sat, Apr 21, 2018, 07:59 Serhiy Storchaka wrote: > 21.04.18 17:47, Chris Angelico пише: > > On Sat, Apr 21, 2018 at 10:29 PM, Serhiy Storchaka > wrote: > >> 21.04.18 13:42, Chris Angelico пише: > >>> >

Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Serhiy Storchaka
21.04.18 17:47, Chris Angelico пише: On Sat, Apr 21, 2018 at 10:29 PM, Serhiy Storchaka wrote: 21.04.18 13:42, Chris Angelico пише: What you're seeing there is actually the peephole optimizer at work. Since 3.7 constant folding is the AST optimizer work. The end

Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Chris Angelico
On Sat, Apr 21, 2018 at 10:29 PM, Serhiy Storchaka wrote: > 21.04.18 13:42, Chris Angelico пише: >> >> What you're seeing there is actually the peephole optimizer at work. > > > Since 3.7 constant folding is the AST optimizer work. The end result is the > same in most cases

Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Serhiy Storchaka
21.04.18 13:42, Chris Angelico пише: What you're seeing there is actually the peephole optimizer at work. Since 3.7 constant folding is the AST optimizer work. The end result is the same in most cases though. Other optimization takes place here too. Constants strings that look like

Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Paul Moore
On 21 April 2018 at 11:42, Chris Angelico wrote: > On Sat, Apr 21, 2018 at 8:25 PM, Yinbin Ma wrote: >> Hi all: >> >> I notice that if concatenating two stringobjects, PVM will not check the >> dictionary of interned string. For example: >> > a =

Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Chris Angelico
On Sat, Apr 21, 2018 at 8:25 PM, Yinbin Ma wrote: > Hi all: > > I notice that if concatenating two stringobjects, PVM will not check the > dictionary of interned string. For example: > a = "qwerty" b = "qwe" c = "rty" d = b+c id(a) > 4572089736

[Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Yinbin Ma
Hi all: I notice that if concatenating two stringobjects, PVM will not check the dictionary of interned string. For example: >>> a = "qwerty" >>> b = "qwe" >>> c = "rty" >>> d = b+c >>> id(a) 4572089736 >>> id(d) 457276 >>> e = "".join(["qwe","rty"]) >>> id(e) 4546460280 But if