摘要:
The crucial importance of properties is that their existence makes it perfectly safe and indeed advisable for you to expose public data attributes as 阅读全文
摘要:
Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once. Not the same, but related. One is about s 阅读全文
摘要:
The people bashing threads are typically system programmers which have in mind use cases that the typical application programmer will never encounter 阅读全文
摘要:
A line such as yield item produces a value that is received by the caller of next(...), and it also gives way, suspending the execution of the generat 阅读全文
摘要:
In this chapter, we will discuss control flow features that are not so common in other languages, and for this reason tend to be overlooked or underus 阅读全文
摘要:
Iteration is fundamental to data processing. And when scanning datasets that don't fit in memory, we need a way to fetch the items lazily, that is, on 阅读全文
摘要:
Operator overloading allows user-defined objects to interoperate with infix operators such as + and | or unary operators like - and ~ . More generally 阅读全文
摘要:
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 阅读全文
摘要:
An abstract class represents an interface. Interfaces are the subject of this chapter: from the dynamic protocols that are the hallmark of ducking typ 阅读全文
摘要:
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 阅读全文