豆瓣
扫码直接下载
读过 Fluent Python, 2nd Edition
In contrast, consider Go. Some objects in that language have features that are magic, in the sense that we cannot emulate them in our own user-defined types. For example, Go arrays, strings, and maps support the use brackets for item access, as in a[i]. But there’s no way to make the [] notation work with a new collection type that you define. Even worse, Go has no user-level concept of an iterable interface or an iterator object, therefore its for/range syntax is limited to supporting five “magic” built-in types, including arrays, strings, and maps. Maybe in the future, the designers of Go will enhance its metaobject protocol. But currently, it is much more limited than what we have in Python or Ruby.引自第1页Go 哈哈哈哈哈哈哈
Go 哈哈哈哈哈哈哈
> 夏夜寂寞属壁虎的所有笔记(179篇)
装饰器模式的更多应用也可以参考陈皓的《Python修饰器的函数式编程》,评论也值得一看: http...
这章讲的两个重构场景都很精妙,活用了设计模式,这就是设计模式该用到的场合啊!(为什么要...
表示其中内容是对原文的摘抄