News for hackers. Stuff that matters.
Re:Javascript-Style Objects in Python by icebraining on Monday March 16, 2015 @01:40PM (#9212933)
Look, ma, dots!

  >>> def Cat(name):
        def hello():
          print "I'm "+name
        hello.__dict__ = {
          'hello': hello,
        }
        return hello
  >>> c = Cat('snuffels')
  >>> c.hello()
  I'm snuffels

There are no comments on this comment yet.