|
|
|
|
|
by chickamade
6064 days ago
|
|
I'd say that name-based interface is indeed Pythonic. > Any type that has the named methods [...] is said to implement the interface. For instance, in the tutorial, the cat function takes a reader interface. fmt.Print and Println a type will output whatever its String() "method" output. This is what Python does, e.g. "print x" is eqv. to "print x.__str__()". |
|