News for hackers. Stuff that matters.
Re:Python's Mutable Default Problem by fleitz on Sunday February 20, 2011 @07:13PM (#2243625)
This is why I love F#.

It lets you define the name of the this parameter in exactly the same way you pass it.

  type Bar(p) =
    member x.Foo(bar) = printf "%s %d" bar p 

  let x = new Bar(10)
  x.Foo("Foo bar")
Output:

  Foo bar 10
And yes, the variables bar and p are type inferred from the %s and %d respectively
Re:Python's Mutable Default Problem by code_duck on Sunday February 20, 2011 @11:11PM (#2244230)
You can rename self to whatever you want in Python by changing it in the function definition.

    class Flip(object):
        foo=4
        def flop(x,num):
            x.bar=x.foo+num
Re:Python's Mutable Default Problem by xiongchiamiov on Monday February 21, 2011 @04:37AM (#2244863)
Right, but his point was that the self variable is declared in front of the method name, similarly to how it looks when you call said method.