This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients docs@python, ezio.melotti, tocretpa
Date 2016-02-29.10:30:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456741845.53.0.996396907156.issue26458@psf.upfronthosting.co.za>
In-reply-to
Content
This is not a bug, see https://docs.python.org/3.6/faq/programming.html#why-are-default-values-shared-between-objects

In the first case L is evaluated once at compile time.
In the second case L is always set to a new empty list, regardless of what you pass as second argument to f.
In the third case L is set to a new empty list only if you don't pass a second argument (or if you pass None).
History
Date User Action Args
2016-02-29 10:30:45ezio.melottisetrecipients: + ezio.melotti, docs@python, tocretpa
2016-02-29 10:30:45ezio.melottisetmessageid: <1456741845.53.0.996396907156.issue26458@psf.upfronthosting.co.za>
2016-02-29 10:30:45ezio.melottilinkissue26458 messages
2016-02-29 10:30:45ezio.melotticreate