Created
April 5, 2013 21:35
-
-
Save arn-e/5322814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python | |
def my_func(arg_1 = []): | |
arg_1.append(1) | |
print arg_1 | |
my_func() | |
my_func() | |
# $ python test.py | |
# [1] | |
# [1, 1] | |
# Ruby | |
def my_func(arg_1=[]) | |
arg_1.push(1) | |
p arg_1 | |
end | |
my_func | |
my_func | |
# $ ruby test.rb | |
# [1] | |
# [1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment