python-distilled
python-distilled copied to clipboard
Resources for Python Distilled (Book)
In page 106, the docstrings of function factorial has a typo. ``` ''' Computes n factorial. For example: >>> factorial(6) 120 >>> ''' ``` The factorial(6) should be **720**.
Is there any reason sets are not included in below sentence ? "When you use an expression to determine a true or false value, True , any nonzero number, a...
The code snippet that appears after the generators used to match a pattern in lines read from a file contains some typos that will raise a `NameError`. Change from ```...
Thank you for writing this book! _Python Distilled_ is a worthy replacement for _Python Essential Reference_. In section 6.6 the code snippet that demonstrates the enhanced generator `line_receiver` is missing...
In Chapter 7, subchapter "7.7 Inheritance", page 160, in the first code example, the sub class is defined as `class MyAcount(Account)` so I guess a `c` is missing in the...
Original version -- attempting to access _mimetype_ attribute of string object: ``` def register_decoder(cls): for mt in cls.mimetypes: _registry[mt.mimetype] = cls return cls ``` Fixed version: ``` def register_decoder(cls): for...
For 5.4.3 (on page 103), the following should be corrected: original ``` func('hello', 3, z=[1, 2], y=22) func(3, 22, w='hello', z=[1, 2]) # TypeError. Multiple values for x ``` corrected...
Thank you so much for your book, it's nothing short of amazing. On to the issue - I am not sure if I just didn't understand correctly or if it...
In section 10.1, Table 10.1 "Operations on Bytes and Bytearrays": > `s.maketrans(x [, y [, z]])` Makes a translation table for `s.translate()`. For `bytes` and `bytearray`, `maketrans()` takes two arguments:...
Hello, thanks for great book, don't know if its in pdf but in o'reilly view "line_receiver" generator is decorated with "consumer" decorator whitch isn't defined anywhere (but when clicking on...