{"action":"opened","issue":{"url":"https://api.github.com/repos/atztogo/phonopy/issues/13","labels_url":"https://api.github.com/repos/atztogo/phonopy/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/atztogo/phonopy/issues/13/comments","events_url":"https://api.github.com/repos/atztogo/phonopy/issues/13/events","html_url":"https://github.com/atztogo/phonopy/issues/13","id":125892036,"number":13,"title":"Mutable values in defaults","user":{"login":"jochym","id":5993422,"avatar_url":"https://avatars.githubusercontent.com/u/5993422?v=3","gravatar_id":"","url":"https://api.github.com/users/jochym","html_url":"https://github.com/jochym","followers_url":"https://api.github.com/users/jochym/followers","following_url":"https://api.github.com/users/jochym/following{/other_user}","gists_url":"https://api.github.com/users/jochym/gists{/gist_id}","starred_url":"https://api.github.com/users/jochym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jochym/subscriptions","organizations_url":"https://api.github.com/users/jochym/orgs","repos_url":"https://api.github.com/users/jochym/repos","events_url":"https://api.github.com/users/jochym/events{/privacy}","received_events_url":"https://api.github.com/users/jochym/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-11T08:10:21Z","updated_at":"2016-01-11T08:10:21Z","closed_at":null,"body":"I have used quantified code automatic style check on my repositories. It has found some issues with the code. Some are minor or not important but some are potentially quite serious. I will try to correct\r\nthese issues or accept their automatic fix into my tree. I am starting with the following issue: you should never use mutable data as a default value of the argument of the function.\r\nThis is potentially dangerous - if the mutable default value is changed inside the function the default will change for every subsequent call to the function and if it is returned and used it will influence every place it is used in the code. It is often a source for obscure and difficult to trace errors. The important feature here is that the defaults are *not* generated when the function is called but when they are *defined*. I do not know if you want this corrections as pull requests, diffs or some other form. This particular fix is commit 0b952cbd60b1b1d1b2ac32eb19a0fd99bf90caeb - you can cherry-pick it from my tree or I will generate pull request (tell me against which branch you want it)."}}