New submission from Sérgio Surkamp <ser...@gruposinternet.com.br>:

The documentation states that the default value of function parameter, if 
mutable, can change it's default value at runtime due to be evaluated only once 
on function object creation.

I would like to suggest the inclusion of an default language warning when this 
kind of construction is used, as it's Python specific behavior and can lead to 
"strange behavior" or misuse by programmers that are migrating from other 
languages to Python.

Documentation reference:
http://docs.python.org/reference/compound_stmts.html#function

----------
components: None
messages: 114394
nosy: surkamp
priority: normal
severity: normal
status: open
title: Mutable default function parameter warning
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9646>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to