Skip to content

Instantly share code, notes, and snippets.

@knzai
Created February 12, 2015 23:44
Show Gist options
  • Save knzai/eca0966bb3b13e7417e2 to your computer and use it in GitHub Desktop.
Save knzai/eca0966bb3b13e7417e2 to your computer and use it in GitHub Desktop.
returning self means mutation
# If you return self you have either mutated self, mutated something else (essentially global, even worse)
# or thrown away the change as a NOOP. Let's play with examples?
@knzai
Copy link
Author

knzai commented Feb 12, 2015

Come up with an example of a function that is not a NOOP and returns self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment