[New-bugs-announce] [issue27942] Default value identity regression

Kay Hayen report at bugs.python.org
Fri Sep 2 12:45:37 EDT 2016


New submission from Kay Hayen:

Consider this:

def defaultKeepsIdentity(arg = "str_value"):
    print(arg is "str_value")

defaultKeepsIdentity()

This has been outputing "True" on every Python release I have seen so far, but not so on 3.6.0a4. Normally string values come from a "co_const" and will be "is" identical if used as literals in a module, but no longer in this case.

This seems wasteful at best, needlessly increasing the number of strings in usage. 

Yours,
Kay

----------
components: Interpreter Core
messages: 274257
nosy: Kay.Hayen
priority: normal
severity: normal
status: open
title: Default value identity regression
type: resource usage
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27942>
_______________________________________


More information about the New-bugs-announce mailing list