Skip to content

Instantly share code, notes, and snippets.

@non-static
Created December 1, 2013 09:06
Show Gist options
  • Save non-static/7730222 to your computer and use it in GitHub Desktop.
Save non-static/7730222 to your computer and use it in GitHub Desktop.
class Complex:
def __init__(self, real, imag, name):
self.r = real
self.i = imag
self.name = name
name = 'Complex_default'
r = 0.0
i = 1.1
doc = "default doc"
def foo(self, num):
self.r = self.r + num
x = Complex(1.0, 3,5)
Complex.foo(x, 5)
print(x.r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment