Skip to content

Instantly share code, notes, and snippets.

@knzconnor
Created February 12, 2015 23:44
Show Gist options
  • Save knzconnor/eca0966bb3b13e7417e2 to your computer and use it in GitHub Desktop.
Save knzconnor/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?
@knzconnor
Copy link
Author

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