6 ms·
In general, Python method is just combination of function object and pointer to "self" namespace.
by mimighost 12y ago
In general, Python method is just combination of function object and pointer to "self" namespace.
- agumonkey 12y agoI'd like to know if it's done differently in other languages. In my view, methods are curried function over self with a '.' syntactic shortcut.
- collyw 12y agoThat's pretty much how I view them as well.
- agumonkey 12y agoGreat then.
- kazagistar 12y agoLua does not do the currying bit, but it does a lot less OOP and a lot more "dictionaries with stuff that can do something like prototype OOP if you squint hard enough". Java and whatnot just don't let you really use methods as first class citizens, so it doesn't matter.
- agumonkey 12y agoIIRC under the hood Java will 'evaluate' the methods body as a sophisticated function with 'this' in its environment.