3 ms·
Python is my goto language but let's not forget it disrespects it's own mantra very often. Like a certain pirate would say, "it's more what you call a guideline
by sametmax 8y ago
Python is my goto language but let's not forget it disrespects it's own mantra very often. Like a certain pirate would say, "it's more what you call a guideline than actual rules".
Duck typing is implicit interface.
Foo().bar() is an implicit Foo.bar(Bar()) as self is only explicit on declaration, not call.
__init__ is called and passed parameters implicitly.
__new__ is an implicit class method.
Some time the magic is nice to have. Sometime it's like yield.
Yield implicitly turns your function into a very different object, which makes everybody goes wtf the few first times.
They fixed that with async / await, but I still wish we had a "gen def" to allow yield in bodies, like we have "async def".