example-code icon indicating copy to clipboard operation
example-code copied to clipboard

Example code for the book Fluent Python, 1st Edition (O'Reilly, 2015)

Results 24 example-code issues
Sort by recently updated
recently updated
newest added

The toxiproxy settings for localhost:8003 (25% error, 50% delay) are as below. ``` TODO: UPDATE NEXT PARAGRAPH There is also the XXX script which runs a proxy on port 8003...

According to my understanding of hashing and equality, I tried to enhance the performance of equality checking by ensuring that `__eq__` does not perform component based comparison only if vectors...

example 19-5 FrozenJSON ``` def __init__(self, mapping): self.__data = dict(mapping) ➊ def __getattr__(self, name): ➋ if hasattr(self.__data, name): return getattr(self.__data, name) ➌ else: return FrozenJSON.build(self.__data[name]) ➍ ``` self.__data is a...

When running with python 3.6.6, with aiohttp 3.3.2, the 'flags_asyncio.py' script outputs 20 pairs of lines similar to this: `Unclosed client session` `client_session: ` followed by 20 tracebacks similar to...

I see the demo: ''' >>> d = TransformDict(str.lower) >>> d['Foo'] = 5 >>> d['foo'] == d['FOO'] == d['Foo'] == 5 True >>> set(d.keys()) {'Foo'} ''' but , i dont...

In the recent version of aiohttp(v2.x), the default value of charset is `utf-8`, if we use > CONTENT_TYPE = 'text/html; charset=UTF-8' The code will raise the exception below > ValueError:...

When running http server given by **example-code/18-asyncio/charfinder/http_charfinder.py** the error is thrown: `Error handling request Traceback (most recent call last): File "/home/osboxes/.local/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 416, in start resp = yield from self._request_handler(request)...

I run program but can't kill parent proccess. code: ``` #-*- coding:utf-8 -*- from concurrent import futures import os import sys import signal def test(num): import time print os.getpid() time.sleep(100)...