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 <rep...@bugs.python.org>
<http://bugs.python.org/issue27942>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to