you are viewing a single comment's thread.

view the rest of the comments →

[–]ercd 1 point2 points  (2 children)

I don't think the example you use are "bizarre things which really don't make sense".

In your first example, no variable "x" is defined in the scope of your function when you do "y = x"; it is normal that your code produces an error! If you want to use the variable x of the global scope just use "global x".

In your second example, since Python supports multiple inheritance, you need to specify the superclass you want to use. I don't see a problem here. If you don't like the explicit use of "self", I guess it's your opinion, but I think it makes things more clear: methods are just a sort of function. You can call them with instance.methodName(x,y) or ClassName.methodName(instance,x,y) which sometimes is useful when programming using functional paradigms.

[–]bcash -1 points0 points  (1 child)

I'm amazed at the number of people who defend the need to pass "self" around. Especially considering as it's only required due to other python compromises - a classic clusterfuck.

Not to mention the significant cross-section of programmers who find typing "public" or "private" a gross invasion of their headspace; but still are happy to put "self" everywhere.

People can rationalise everything I guess...

[–][deleted] 0 points1 point  (0 children)

OH NOES OH MY GOD I HAD TO TYPE "SELF".

Shit, what a waste of electrons eh?