02 2020 档案

摘要:Operator overloading allows user-defined objects to interoperate with infix operators such as + and | or unary operators like - and ~ . More generally 阅读全文
posted @ 2020-02-29 03:27 neozheng 阅读(102) 评论(0) 推荐(0) 编辑
摘要:1. Subclassing Built-In Types Is Tricky Since Python 2.2, subclassing built-in types such as list or dict can be done but there is a major caveat: the 阅读全文
posted @ 2020-02-25 02:58 neozheng 阅读(194) 评论(0) 推荐(0) 编辑
摘要:An abstract class represents an interface. Interfaces are the subject of this chapter: from the dynamic protocols that are the hallmark of ducking typ 阅读全文
posted @ 2020-02-21 00:51 neozheng 阅读(181) 评论(0) 推荐(0) 编辑
摘要:1. Vector Take #1: Vector2d Compatible The best practice for a sequence constructor is to take the data as an iterable argument in the constructor, li 阅读全文
posted @ 2020-02-17 01:21 neozheng 阅读(219) 评论(0) 推荐(0) 编辑
摘要:1. Object Representations Every object-oriented language has at least one standard way of getting a string representation from any object. Python has 阅读全文
posted @ 2020-02-10 01:07 neozheng 阅读(174) 评论(0) 推荐(0) 编辑
摘要:1. Varaibles Are Labels, Not Boxes. Python varaibles are like reference variables in Java, so it's better to think of them as labels attached to objec 阅读全文
posted @ 2020-02-08 02:41 neozheng 阅读(196) 评论(0) 推荐(0) 编辑
摘要:Function decorators let us "mark" functions in the source code to enhance their behavior in some way. This is powful stuff, but mastering it requires 阅读全文
posted @ 2020-02-03 01:02 neozheng 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Although design patterns are language-independent, that does not mean every pattern applies to every language. If we assumed procedural languages, we 阅读全文
posted @ 2020-02-02 02:16 neozheng 阅读(169) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示