4 ms·
I've actually written a ton of python too. The self parameter didn't confuse me because of OO, but because traits can actually dispatch on the types of all of t
by jamii 11y ago
I've actually written a ton of python too. The self parameter didn't confuse me because of OO, but because traits can actually dispatch on the types of all of their arguments so it wasn't clear to me what the meaning of the self argument was and how much it should affect my design.
Manishearth cleared up most of my confusion - it affects namespacing and auto-borrow but doesn't interact with constraints. Traits are very similar to typeclasses and I was just thrown by the surface level syntax.