Skip to content

Instantly share code, notes, and snippets.

@drj11
Created January 28, 2016 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drj11/c081be0f4be97a22d7b9 to your computer and use it in GitHub Desktop.
Save drj11/c081be0f4be97a22d7b9 to your computer and use it in GitHub Desktop.
a = ['hello']
b = a
def f(x):
pass
# anything you like here
f(a)
print(a is b)
@alistair-broomhead
Copy link

Python 2.7.10 (default, Oct 14 2015, 16:09:02) 
Type "copyright", "credits" or "license" for more information.

IPython 3.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: a = ['hello']

In [2]: b = a

In [3]: 

In [3]: def f(x):
   ...:       pass
   ...:   # anything you like here
   ...:   

In [4]: f(a)

In [5]: print(a is b)
True

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