SYMBOL INDEX (1344 symbols across 85 files) FILE: Chapter_1/ch01_ex3.py function F (line 10) | def F(n: int) -> int: function demo (line 21) | def demo(): FILE: Chapter_1/ch01_ex4.py function factorial (line 13) | def factorial(n: int) -> int: FILE: Chapter_1/ch01_ex5.py class EmptyClass (line 14) | class EmptyClass: FILE: Chapter_10/ch10_bonus.py class Suit (line 17) | class Suit(Enum): class Card (line 23) | class Card: method __init__ (line 25) | def __init__(self, rank: str, suit: Suit, hard: Optional[int]=None, so... method __str__ (line 31) | def __str__(self) -> str: class AceCard (line 35) | class AceCard(Card): method __init__ (line 37) | def __init__(self, rank: str, suit: Suit) -> None: class FaceCard (line 41) | class FaceCard(Card): method __init__ (line 43) | def __init__(self, rank: str, suit: Suit) -> None: function card (line 46) | def card(rank: int, suit: Suit) -> Card: class Deck (line 55) | class Deck(list): method __init__ (line 56) | def __init__(self) -> None: class Hand (line 60) | class Hand(list): method hard (line 62) | def hard(self) -> int: method soft (line 66) | def soft(self) -> int: method __repr__ (line 69) | def __repr__(self) -> str: function deal_rules (line 73) | def deal_rules(deck: Deck) -> Tuple[Hand, Optional[int]]: function simulation (line 88) | def simulation() -> None: FILE: Chapter_10/ch10_ex1.py class Post (line 24) | class Post: method as_dict (line 30) | def as_dict(self) -> Dict[str, Any]: class Blog_x (line 45) | class Blog_x(list): method __init__ (line 47) | def __init__(self, title: str, posts: Optional[List[Post]]=None) -> None: method by_tag (line 51) | def by_tag(self) -> DefaultDict[str, List[Dict[str, Any]]]: method as_dict (line 58) | def as_dict(self) -> Dict[str, Any]: function blogx_encode (line 120) | def blogx_encode(object: Any) -> Dict[str, Any]: function blogx_decode (line 155) | def blogx_decode(some_dict: Dict[str, Any]) -> Dict[str, Any]: class Blog (line 239) | class Blog: method __init__ (line 241) | def __init__(self, title: str, posts: Optional[List[Post]]=None) -> None: method underline (line 246) | def underline(self) -> str: method append (line 249) | def append(self, post: Post) -> None: method by_tag (line 252) | def by_tag(self) -> Dict[str, List[Dict[str, Any]]]: method as_dict (line 259) | def as_dict(self) -> Dict[str, Any]: function blog_encode (line 287) | def blog_encode(object: Any) -> Dict[str, Any]: function blog_decode (line 320) | def blog_decode(some_dict: Dict[str, Any]) -> Dict[str, Any]: function rst_render (line 407) | def rst_render(blog: Blog) -> None: class Post_J (line 574) | class Post_J(Post): method _json (line 577) | def _json(self) -> Dict[str, Any]: class Blog_J (line 586) | class Blog_J(Blog): method _json (line 590) | def _json(self) -> Dict[str, Any]: function blog_j_encode (line 597) | def blog_j_encode(object: Union[Blog_J, Post_J, Any]) -> Dict[str, Any]: function blog_j2_encode (line 711) | def blog_j2_encode(object: Union[Blog_J, Post_J, Any]) -> Dict[str, Any]: FILE: Chapter_10/ch10_ex2.py class Suit (line 19) | class Suit(str, Enum): class Card (line 25) | class Card: method __init__ (line 27) | def __init__(self, rank: str, suit: Suit, hard: Optional[int]=None, so... method __str__ (line 33) | def __str__(self) -> str: class AceCard (line 37) | class AceCard(Card): method __init__ (line 39) | def __init__(self, rank: str, suit: Suit) -> None: class FaceCard (line 43) | class FaceCard(Card): method __init__ (line 45) | def __init__(self, rank: str, suit: Suit) -> None: FILE: Chapter_10/ch10_ex2b.py function card_representer (line 28) | def card_representer(dumper: Any, card: Card) -> str: function acecard_representer (line 33) | def acecard_representer(dumper: Any, card: Card) -> str: function facecard_representer (line 38) | def facecard_representer(dumper: Any, card: Card) -> str: function card_constructor (line 43) | def card_constructor(loader: Any, node: Any) -> Card: function acecard_constructor (line 49) | def acecard_constructor(loader: Any, node: Any) -> Card: function facecard_constructor (line 55) | def facecard_constructor(loader: Any, node: Any) -> Card: FILE: Chapter_10/ch10_ex2c.py class Card2 (line 27) | class Card2(yaml.YAMLObject): method __init__ (line 31) | def __init__(self, rank, suit, hard=None, soft=None) -> None: method __str__ (line 37) | def __str__(self) -> str: class AceCard2 (line 41) | class AceCard2(Card2): method __init__ (line 44) | def __init__(self, rank, suit) -> None: class FaceCard2 (line 48) | class FaceCard2(Card2): method __init__ (line 51) | def __init__(self, rank, suit) -> None: FILE: Chapter_10/ch10_ex3.py class Hand_bad (line 53) | class Hand_bad: method __init__ (line 55) | def __init__(self, dealer_card: Card, *cards: Card) -> None: method append (line 61) | def append(self, card: Card) -> None: method __str__ (line 65) | def __str__(self) -> str: class Hand2 (line 89) | class Hand2: method __init__ (line 91) | def __init__(self, dealer_card: Card, *cards: Card) -> None: method append (line 97) | def append(self, card: Card) -> None: method __str__ (line 101) | def __str__(self) -> str: method __getstate__ (line 105) | def __getstate__(self) -> Dict[str, Any]: method __setstate__ (line 108) | def __setstate__(self, state: Dict[str, Any]) -> None: class RestrictedUnpickler (line 136) | class RestrictedUnpickler(pickle.Unpickler): method find_class (line 138) | def find_class(self, module: str, name: str) -> Any: FILE: Chapter_10/ch10_ex4.py class Table (line 30) | class Table: method bet (line 33) | def bet(self, game_state: str, amount: float) -> None: class Player_Strategy (line 38) | class Player_Strategy: class Betting (line 43) | class Betting: method __init__ (line 45) | def __init__(self, stake: float = 100) -> None: method bet (line 48) | def bet(self, table: Table, game_state: str) -> None: method win (line 52) | def win(self, amount: float) -> None: method loss (line 55) | def loss(self, amount: float) -> None: method push (line 58) | def push(self) -> None: class Flat_Bet (line 62) | class Flat_Bet(Betting): class Martingale_Bet (line 66) | class Martingale_Bet(Betting): method __init__ (line 68) | def __init__(self, *args) -> None: method bet (line 72) | def bet(self, table: Table, game_state: str) -> None: method win (line 80) | def win(self, amount) -> None: method loss (line 84) | def loss(self, amount) -> None: method push (line 88) | def push(self) -> None: class BadBet (line 95) | class BadBet(Exception): class Broke (line 99) | class Broke(Exception): class Blackjack (line 104) | class Blackjack(Table): method __init__ (line 106) | def __init__(self, play: Player_Strategy, betting: Betting) -> None: method stake (line 113) | def stake(self) -> float: method bet (line 116) | def bet(self, game_state: str, amount: float) -> None: method play_1 (line 121) | def play_1(self) -> None: method until_broke_or_rounds (line 137) | def until_broke_or_rounds(self, limit: int) -> None: class GameStat (line 150) | class GameStat(NamedTuple): function gamestat_iter (line 160) | def gamestat_iter( function gamestat_rdr_iter (line 197) | def gamestat_rdr_iter( function blog_builder (line 282) | def blog_builder(row: List[str]) -> Blog: function post_builder (line 286) | def post_builder(row: List[str]) -> Post: function blog_iter (line 316) | def blog_iter(source: TextIO) -> Iterator[Blog]: function post_builder5 (line 365) | def post_builder5(row: Dict[str, str]) -> Post: function blog_builder5 (line 374) | def blog_builder5(row: Dict[str, str]) -> Blog: function blog_iter2 (line 381) | def blog_iter2(source: TextIO) -> Iterator[Blog]: FILE: Chapter_10/ch10_ex5.py class FixedField (line 38) | class FixedField(NamedTuple): class Metadata (line 44) | class Metadata(NamedTuple): function gamestat_record (line 59) | def gamestat_record(gamestat:GameStat, metadata: Metadata) -> str: function line_iter (line 79) | def line_iter(aFile: TextIO, metadata: Union[Metadata, 'XMetadata']) -> ... function record_iter (line 87) | def record_iter(aFile: TextIO, metadata: Metadata) -> Iterator[Dict[str,... function ebcdic_lookup (line 153) | def ebcdic_lookup(name, fallback=codecs.lookup): # real signature unknown function alpha_decode (line 163) | def alpha_decode(data: bytes, metadata: 'XMetadata', field_metadata: 'XF... function display_decode (line 185) | def display_decode(data: bytes, metadata: 'XMetadata', field_metadata: '... function comp3_decode (line 209) | def comp3_decode(data: bytes, metadata: 'XMetadata', field_metadata: 'XF... function alpha_encode (line 241) | def alpha_encode(data: Any, metadata: 'XMetadata', field_metadata: 'XFie... function display_encode (line 265) | def display_encode(data: Decimal, metadata: 'XMetadata', field_metadata:... function comp3_encode (line 294) | def comp3_encode(data: Decimal, metadata: 'XMetadata', field_metadata: '... class XField (line 343) | class XField(NamedTuple): class XMetadata (line 350) | class XMetadata(NamedTuple): method decode (line 356) | def decode(self) -> Callable[[bytes], Tuple[str, int]]: method encode (line 360) | def encode(self) -> Callable[[str], Tuple[bytes, int]]: function gamestat_record_comp3 (line 376) | def gamestat_record_comp3(gamestat: GameStat, metadata: XMetadata) -> by... function record2_iter (line 395) | def record2_iter(aFile: TextIO, metadata: XMetadata) -> Iterator[Dict[st... FILE: Chapter_10/ch10_ex6.py class Post_X (line 30) | class Post_X: method __post_init__ (line 38) | def __post_init__(self) -> None: method as_dict (line 42) | def as_dict(self) -> Dict[str, Any]: method xml (line 45) | def xml(self) -> str: class Blog_X (line 59) | class Blog_X: method __post_init__ (line 64) | def __post_init__(self) -> None: method append (line 67) | def append(self, post: Post_X) -> None: method by_tag (line 70) | def by_tag(self) -> DefaultDict[str, List[Dict[str, Any]]]: method as_dict (line 77) | def as_dict(self) -> Dict[str, Any]: method xml (line 80) | def xml(self) -> str: class Blog_E (line 135) | class Blog_E(Blog_X): method xmlelt (line 137) | def xmlelt(self) -> XML.Element: class Post_E (line 148) | class Post_E(Post_X): method xmlelt (line 150) | def xmlelt(self) -> XML.Element: function build_blog (line 195) | def build_blog(document: XML.ElementTree) -> Blog_X: FILE: Chapter_11/ch11_ex1.py class Post (line 26) | class Post: class Blog (line 34) | class Blog: method __post_init__ (line 43) | def __post_init__(self) -> None: method append (line 46) | def append(self, post: Post) -> None: method by_tag (line 49) | def by_tag(self) -> Dict[str, List[Dict[str, Any]]]: FILE: Chapter_11/ch11_ex2.py class Post (line 21) | class Post: method __post_init__ (line 34) | def __post_init__(self) -> None: class Blog (line 39) | class Blog: method __post_init__ (line 48) | def __post_init__(self) -> None: method by_tag (line 51) | def by_tag(self, access: 'Access') -> Dict[str, List[Dict[str, Any]]]: class OperationError (line 110) | class OperationError(Exception): class Access (line 114) | class Access: method __init__ (line 116) | def __init__(self) -> None: method new (line 120) | def new(self, path: Path) -> None: method open (line 125) | def open(self, path: Path) -> None: method close (line 129) | def close(self) -> None: method sync (line 135) | def sync(self) -> None: method create_blog (line 139) | def create_blog(self, blog: Blog) -> Blog: method retrieve_blog (line 146) | def retrieve_blog(self, key: str) -> Blog: method create_post (line 149) | def create_post(self, blog: Blog, post: Post) -> Post: method retrieve_post (line 157) | def retrieve_post(self, key: str) -> Post: method update_post (line 160) | def update_post(self, post: Post) -> Post: method delete_post (line 164) | def delete_post(self, post: Post) -> None: method __iter__ (line 167) | def __iter__(self) -> Iterator[Union[Blog, Post]]: method blog_iter (line 174) | def blog_iter(self) -> Iterator[Blog]: method post_iter (line 179) | def post_iter(self, blog: Blog) -> Iterator[Post]: method post_title_iter (line 185) | def post_title_iter(self, blog: Blog, title: str) -> Iterator[Post]: method blog_title_iter (line 188) | def blog_title_iter(self, title: str) -> Iterator[Blog]: function database_script (line 195) | def database_script(access: Access) -> None: class Render (line 237) | class Render: method __init__ (line 239) | def __init__(self, access: Access) -> None: method emit_all (line 242) | def emit_all(self, destination: TextIO=sys.stdout) -> None: method emit_blog (line 247) | def emit_blog(self, blog: Blog, output: TextIO) -> None: method emit_post (line 257) | def emit_post(self, post: Post) -> None: method emit_index (line 272) | def emit_index(self) -> None: class Access2 (line 302) | class Access2(Access): method create_post (line 304) | def create_post(self, blog: Blog, post: Post) -> Post: method delete_post (line 312) | def delete_post(self, post: Post) -> None: method post_iter (line 320) | def post_iter(self, blog: Blog) -> Iterator[Post]: class Access3 (line 355) | class Access3(Access2): method new (line 357) | def new(self, path: Path) -> None: method create_blog (line 361) | def create_blog(self, blog: Blog) -> Blog: method blog_iter (line 366) | def blog_iter(self) -> Iterator[Blog]: class Access4 (line 398) | class Access4(Access3): method new (line 400) | def new(self, path: Path) -> None: method create_blog (line 404) | def create_blog(self, blog): method update_blog (line 412) | def update_blog(self, blog: Blog) -> Blog: method blog_iter (line 431) | def blog_iter(self) -> Iterator[Blog]: method blog_title_iter (line 434) | def blog_title_iter(self, title: str) -> Iterator[Blog]: function create (line 470) | def create(access, blogs=100, posts_per_blog=100) -> None: function performance (line 484) | def performance(cycles=3): FILE: Chapter_12/ch12_ex2.py function adapt_currency (line 18) | def adapt_currency(value): function convert_currency (line 25) | def convert_currency(bytes): FILE: Chapter_12/ch12_ex3.py class Blog (line 24) | class Blog: method __post_init__ (line 33) | def __post_init__(self) -> None: method entries (line 37) | def entries(self) -> List['Post']: method by_tag (line 43) | def by_tag(self) -> Dict[str, List[Dict[str, Any]]]: class Post (line 49) | class Post: method append (line 57) | def append(self, tag): class Access (line 62) | class Access: method open (line 67) | def open(self, path: Path) -> None: method get_blog (line 71) | def get_blog(self, id: str) -> Blog: method add_blog (line 81) | def add_blog(self, blog: Blog) -> Blog: method get_post (line 91) | def get_post(self, id: str) -> Post: method add_post (line 111) | def add_post(self, blog: Blog, post: Post) -> Post: method blog_iter (line 155) | def blog_iter(self) -> Iterator[Blog]: method post_iter (line 166) | def post_iter(self, blog: Blog) -> Iterator[Post]: method post_by_tag (line 174) | def post_by_tag(self, blog: Blog) -> Dict[str, List[Dict[str, Any]]]: FILE: Chapter_12/ch12_ex4.py class Blog (line 63) | class Blog(Base): method as_dict (line 68) | def as_dict(self): class Post (line 84) | class Post(Base): method as_dict (line 94) | def as_dict(self): class Tag (line 104) | class Tag(Base): FILE: Chapter_13/ch13_e1_ex2.py class Wheel2 (line 42) | class Wheel2(Wheel): method __call__ (line 44) | def __call__( class American2 (line 54) | class American2(DoubleZero, Wheel2): class European2 (line 58) | class European2(Zero, Wheel2): class Wheel3 (line 76) | class Wheel3: method __init__ (line 78) | def __init__(self, seed: Optional[int] = None) -> None: method __call__ (line 82) | def __call__( function roulette_server_3 (line 104) | def roulette_server_3(count: int = 1) -> None: function server_3 (line 119) | def server_3() -> None: FILE: Chapter_13/ch13_e1_ex3.py class Wheel2 (line 42) | class Wheel2(Wheel): method __call__ (line 44) | def __call__( class American2 (line 54) | class American2(DoubleZero, Wheel2): class European2 (line 58) | class European2(Zero, Wheel2): class Wheel3 (line 66) | class Wheel3: method __init__ (line 68) | def __init__(self) -> None: method __call__ (line 72) | def __call__( class Table (line 102) | class Table: method __init__ (line 104) | def __init__(self, stake: int = 100) -> None: method place_bet (line 108) | def place_bet(self, name: str, amount: int) -> None: method clear_bets (line 111) | def clear_bets(self, name: str) -> None: method resolve (line 114) | def resolve(self, spin: Dict[str, Tuple[int, int]]) -> List[Tuple[str,... class WSGI (line 130) | class WSGI: method __call__ (line 132) | def __call__( class RESTException (line 138) | class RESTException(Exception): class Roulette (line 142) | class Roulette(WSGI): method __init__ (line 144) | def __init__(self, wheel: Wheel) -> None: method __call__ (line 149) | def __call__( method player_app (line 172) | def player_app( method bet_app (line 187) | def bet_app( method wheel_app (line 215) | def wheel_app( function roulette_server_3 (line 258) | def roulette_server_3(count: int = 1) -> None: function roulette_client (line 278) | def roulette_client( function server_3 (line 299) | def server_3() -> None: FILE: Chapter_13/ch13_e1_ex4.py class Wheel2 (line 42) | class Wheel2(Wheel): method __call__ (line 44) | def __call__( class American2 (line 54) | class American2(DoubleZero, Wheel2): class European2 (line 58) | class European2(Zero, Wheel2): class Wheel3 (line 66) | class Wheel3: method __init__ (line 68) | def __init__(self): method __call__ (line 72) | def __call__( class Table (line 102) | class Table: method __init__ (line 104) | def __init__(self, stake: int = 100) -> None: method place_bet (line 108) | def place_bet(self, name: str, amount: int) -> None: method clear_bets (line 111) | def clear_bets(self, name: str) -> None: method resolve (line 114) | def resolve(self, spin: Dict[str, Tuple[int, int]]) -> List[Tuple[str,... class WSGI (line 130) | class WSGI: method __call__ (line 132) | def __call__( class RESTException (line 138) | class RESTException(Exception): class Roulette (line 142) | class Roulette(WSGI): method __init__ (line 144) | def __init__(self, wheel): method __call__ (line 149) | def __call__( method player_app (line 172) | def player_app( method bet_app (line 187) | def bet_app( method wheel_app (line 215) | def wheel_app( function roulette_server_4 (line 258) | def roulette_server_4(count: int = 1): function roulette_client (line 278) | def roulette_client(method="GET", path="/", data=None): class Authentication (line 305) | class Authentication: method __init__ (line 308) | def __init__(self, username: bytes, password: bytes, salt: Optional[by... method _iter_hash (line 315) | def _iter_hash(iterations: int, salt: bytes, username: bytes, password... method __eq__ (line 321) | def __eq__(self, other: Any) -> bool: method __hash__ (line 325) | def __hash__(self) -> int: method __repr__ (line 328) | def __repr__(self) -> str: method match (line 333) | def match(self, password: bytes) -> bool: class Users (line 339) | class Users(dict): method __init__ (line 341) | def __init__(self, *args, **kw) -> None: method add (line 346) | def add(self, authentication: Authentication) -> None: method match (line 351) | def match(self, username: bytes, password: bytes) -> bool: class Authenticate (line 384) | class Authenticate(WSGI): method __init__ (line 386) | def __init__(self, users, target_app): method __call__ (line 390) | def __call__( class Some_App (line 410) | class Some_App(WSGI): method __call__ (line 412) | def __call__( function authenticated_client (line 425) | def authenticated_client( function auth_server (line 454) | def auth_server(count: int = 1) -> None: function server_5 (line 470) | def server_5() -> None: FILE: Chapter_13/ch13_ex1.py class Wheel (line 55) | class Wheel: method __init__ (line 58) | def __init__(self, seed: Optional[int] = None) -> None: method zero (line 73) | def zero(self) -> List[Dict[str, Tuple[int, int]]]: method redblack (line 77) | def redblack(n: int) -> str: method hilo (line 83) | def hilo(n: int) -> str: method evenodd (line 87) | def evenodd(n: int) -> str: method spin (line 90) | def spin(self) -> Dict[str, Tuple[int, int]]: class Zero (line 94) | class Zero: method zero (line 96) | def zero(self) -> List[Dict[str, Tuple[int, int]]]: class DoubleZero (line 100) | class DoubleZero(Zero): method zero (line 102) | def zero(self) -> List[Dict[str, Tuple[int, int]]]: class American (line 108) | class American(DoubleZero, Wheel): class European (line 112) | class European(Zero, Wheel): function wsgi_wheel (line 155) | def wsgi_wheel( function roulette_server (line 176) | def roulette_server(count: int = 1) -> None: class Response (line 194) | class Response(NamedTuple): method __str__ (line 199) | def __str__(self) -> str: function json_get (line 203) | def json_get(path: str = "/") -> Response: function server (line 226) | def server() -> None: FILE: Chapter_13/ch13_ex2.py class Domino (line 21) | class Domino: method double (line 26) | def double(self): method __repr__ (line 29) | def __repr__(self): class Boneyard (line 36) | class Boneyard: method __init__ (line 47) | def __init__(self, limit=6): method deal (line 53) | def deal(self, tiles: int = 7, hands: int = 4) -> List[List[Tuple[int,... function dominoes (line 73) | def dominoes(n: str) -> Tuple[Dict[str, Any], int]: function hands (line 89) | def hands(h: int, c: int) -> Tuple[Dict[str, Any], int]: function openapi (line 121) | def openapi() -> Dict[str, Any]: FILE: Chapter_13/ch13_ex3.py class Status (line 21) | class Status(str, Enum): class Dice (line 27) | class Dice: method reroll (line 32) | def reroll(self, keep_positions: List[int]) -> None: function make_dice (line 39) | def make_dice(n_dice: int) -> Dice: function openapi (line 89) | def openapi() -> Dict[str, Any]: function make_roll (line 95) | def make_roll() -> Tuple[Dict[str, Any], HTTPStatus, Dict[str, str]]: function get_roll (line 113) | def get_roll(identifier) -> Tuple[Dict[str, Any], HTTPStatus]: function patch_roll (line 121) | def patch_roll(identifier) -> Tuple[Dict[str, Any], HTTPStatus]: class BadRequest (line 138) | class BadRequest(Exception): function make_app (line 142) | def make_app() -> Flask: FILE: Chapter_13/ch13_ex4.py function demo (line 17) | def demo(headers=None): function mock_requests (line 54) | def mock_requests(monkeypatch): function test_demo (line 75) | def test_demo(mock_requests): FILE: Chapter_13/ch13_ex5.py function init_app (line 56) | def init_app(app): function valid_api_key (line 66) | def valid_api_key(view_function: Callable) -> Callable: function api_key_in (line 79) | def api_key_in(valid_values: Set[str]): function openapi (line 102) | def openapi() -> Dict[str, Any]: function create_roll (line 109) | def create_roll() -> Tuple[Any, HTTPStatus, Dict[str, Any]]: function get_roll (line 131) | def get_roll(identifier) -> Tuple[Dict[str, Any], HTTPStatus]: function patch_roll (line 142) | def patch_roll(identifier) -> Tuple[Dict[str, Any], HTTPStatus]: class BadRequest (line 164) | class BadRequest(Exception): function make_app (line 168) | def make_app() -> Flask: FILE: Chapter_13/ch13_ex6.py class Simulation (line 21) | class Simulation(multiprocessing.Process): method __init__ (line 23) | def __init__( method run (line 32) | def run(self) -> None: class Summarize (line 46) | class Summarize(multiprocessing.Process): method __init__ (line 48) | def __init__(self, queue: multiprocessing.SimpleQueue) -> None: method run (line 52) | def run(self) -> None: function server_6 (line 68) | def server_6() -> None: FILE: Chapter_13/simulation_model.py class DealerRule (line 17) | class DealerRule: class Hit17 (line 21) | class Hit17(DealerRule): class Stand17 (line 26) | class Stand17(DealerRule): class SplitRule (line 31) | class SplitRule: class ReSplit (line 35) | class ReSplit(SplitRule): class NoReSplit (line 40) | class NoReSplit(SplitRule): class NoReSplitAces (line 45) | class NoReSplitAces(SplitRule): class Table (line 50) | class Table: method __init__ (line 52) | def __init__(self, decks: int, limit: int, dealer: DealerRule, split: ... method as_tuple (line 59) | def as_tuple(self): class PlayerStrategy (line 69) | class PlayerStrategy: class SomeStrategy (line 73) | class SomeStrategy(PlayerStrategy): class AnotherStrategy (line 77) | class AnotherStrategy(PlayerStrategy): class BettingStrategy (line 81) | class BettingStrategy: method bet (line 83) | def bet(self) -> int: method record_win (line 86) | def record_win(self) -> None: method record_loss (line 89) | def record_loss(self) -> None: class Flat (line 93) | class Flat(BettingStrategy): class Martingale (line 97) | class Martingale(BettingStrategy): class OneThreeTwoSix (line 101) | class OneThreeTwoSix(BettingStrategy): class Player (line 105) | class Player: method __init__ (line 107) | def __init__(self, play: PlayerStrategy, betting: BettingStrategy, rou... method reset (line 113) | def reset(self) -> None: method as_tuple (line 117) | def as_tuple(self) -> Tuple: class Simulate (line 132) | class Simulate: method __init__ (line 134) | def __init__( method __iter__ (line 145) | def __iter__(self) -> Iterator[Tuple]: FILE: Chapter_14/ch14_ex1.py function simulate_blackjack (line 19) | def simulate_blackjack() -> None: function location_list (line 50) | def location_list(config_name: str = "someapp.config") -> List[Path]: function main_ini (line 119) | def main_ini(config: configparser.ConfigParser) -> None: FILE: Chapter_14/ch14_ex2.py function simulate (line 27) | def simulate(table: Table, player: Player, outputpath: Path, samples: in... function simulate_SomeStrategy_Flat (line 38) | def simulate_SomeStrategy_Flat() -> None: class AppConfig (line 63) | class AppConfig: function simulate_c (line 74) | def simulate_c(config: Union[Type[AppConfig], SimpleNamespace]) -> None: class Example2 (line 82) | class Example2(AppConfig): function make_config (line 166) | def make_config( FILE: Chapter_14/ch14_ex3.py function simulate (line 21) | def simulate(table: Table, player: Player, outputpath: Path, samples: in... class AttrChainMap (line 172) | class AttrChainMap(ChainMap): method __getattr__ (line 174) | def __getattr__(self, name: str) -> Any: method __setattr__ (line 179) | def __setattr__(self, name: str, value: Any) -> None: FILE: Chapter_14/ch14_ex4.py function main_nested_dict (line 54) | def main_nested_dict(config: Dict[str, Any]) -> None: function simulate (line 133) | def simulate(table: Table, player: Player, outputpath: Path, samples: in... function main_cm (line 141) | def main_cm(config: Dict[str, Any]) -> None: FILE: Chapter_14/ch14_ex5.py class PropertyParser (line 74) | class PropertyParser: method read_string (line 76) | def read_string(self, data: str) -> Iterator[Tuple[str, str]]: method read_file (line 79) | def read_file(self, file: IO[str]) -> Iterator[Tuple[str, str]]: method read (line 83) | def read(self, path: Path) -> Iterator[Tuple[str, str]]: method _parse (line 89) | def _parse(self, data: str) -> Iterator[Tuple[str, str]]: method load (line 109) | def load( method loads (line 119) | def loads(self, data: str) -> Iterator[Tuple[str, str]]: method _escape (line 122) | def _escape(self, data: str) -> str: method _escape2 (line 127) | def _escape2(self, data: str) -> str: function main_cm_prop (line 186) | def main_cm_prop(config): FILE: Chapter_14/ch14_ex6.py class Configuration (line 122) | class Configuration: method read_file (line 124) | def read_file(self, file): method read (line 127) | def read(self, filename): method read_string (line 130) | def read_string(self, text): method get (line 133) | def get(self, qual_name, default): method __getitem__ (line 141) | def __getitem__(self, section): function main_cm_prop (line 146) | def main_cm_prop(config): FILE: Chapter_14/simulation_model.py class DealerRule (line 20) | class DealerRule: method __repr__ (line 22) | def __repr__(self) -> str: class Hit17 (line 25) | class Hit17(DealerRule): class Stand17 (line 30) | class Stand17(DealerRule): class SplitRule (line 35) | class SplitRule: method __repr__ (line 37) | def __repr__(self) -> str: class ReSplit (line 41) | class ReSplit(SplitRule): class NoReSplit (line 46) | class NoReSplit(SplitRule): class NoReSplitAces (line 51) | class NoReSplitAces(SplitRule): class Table (line 57) | class Table: class PlayerStrategy (line 66) | class PlayerStrategy: method __repr__ (line 68) | def __repr__(self) -> str: class SomeStrategy (line 72) | class SomeStrategy(PlayerStrategy): class AnotherStrategy (line 76) | class AnotherStrategy(PlayerStrategy): class BettingStrategy (line 80) | class BettingStrategy: method __repr__ (line 82) | def __repr__(self) -> str: method bet (line 85) | def bet(self) -> int: method record_win (line 88) | def record_win(self) -> None: method record_loss (line 91) | def record_loss(self) -> None: class Flat (line 95) | class Flat(BettingStrategy): class Martingale (line 99) | class Martingale(BettingStrategy): class OneThreeTwoSix (line 103) | class OneThreeTwoSix(BettingStrategy): class Player (line 108) | class Player: method __post_init__ (line 118) | def __post_init__(self): method reset (line 121) | def reset(self) -> None: class Simulate (line 131) | class Simulate: method __iter__ (line 138) | def __iter__(self) -> Iterator[Tuple]: function check (line 162) | def check(path: Path) -> None: FILE: Chapter_15/ch15_ex1.py class DominoBoneYard (line 15) | class DominoBoneYard: method __init__ (line 46) | def __init__(self, limit: int = 6) -> None: method double (line 50) | def double(self, domino: Tuple[int, int]) -> bool: method score (line 54) | def score(self, domino: Tuple[int, int]) -> int: method hand_iter (line 57) | def hand_iter(self, players: int = 4) -> Iterator[List[Tuple[int, int]]]: method can_play_first (line 61) | def can_play_first(self, hand: List[Tuple[int, int]]) -> bool: method score_hand (line 67) | def score_hand(self, hand: List[Tuple[int, int]]) -> int: method rank_hand (line 70) | def rank_hand(self, hand: List[Tuple[int, int]]) -> None: method doubles_indices (line 73) | def doubles_indices(self, hand: List[Tuple[int, int]]) -> List[int]: class Domino (line 81) | class Domino(NamedTuple): method double (line 85) | def double(self) -> bool: method score (line 88) | def score(self) -> int: class Hand (line 92) | class Hand(list): method score (line 94) | def score(self) -> int: method rank (line 97) | def rank(self) -> None: method doubles_indices (line 100) | def doubles_indices(self) -> List[int]: class DominoBoneYard2 (line 104) | class DominoBoneYard2: method __init__ (line 106) | def __init__(self, limit: int = 6) -> None: method hand_iter (line 110) | def hand_iter(self, players: int = 4) -> Iterator[Hand]: class Hand3 (line 152) | class Hand3(Hand): method highest_double_index (line 154) | def highest_double_index(self) -> Optional[int]: class DominoBoneYard3 (line 165) | class DominoBoneYard3(DominoBoneYard2): method hand_iter (line 167) | def hand_iter(self, players: int = 4) -> Iterator[Hand3]: class FancyDealer4 (line 193) | class FancyDealer4: method __init__ (line 195) | def __init__(self): method hand_iter (line 198) | def hand_iter( class DominoBoneYard3b (line 224) | class DominoBoneYard3b: method __init__ (line 228) | def __init__(self, limit: int = 6) -> None: method hand_iter (line 232) | def hand_iter(self, players: int = 4) -> Iterator[Hand3]: class DominoBoneYard3c (line 259) | class DominoBoneYard3c: method __init__ (line 267) | def __init__(self, limit: int = 6) -> None: method hand_iter (line 273) | def hand_iter(self, players: int = 4) -> Iterator[Hand]: class Hand4 (line 280) | class Hand4(Hand3): method __init__ (line 282) | def __init__(self, *args) -> None: method doubles_indices (line 287) | def doubles_indices(self) -> List[int]: FILE: Chapter_15/ch15_ex2.py class Domino_1 (line 29) | class Domino_1(NamedTuple): method double (line 34) | def double(self) -> bool: method score (line 38) | def score(self) -> int: class Domino_2 (line 46) | class Domino_2: method double (line 51) | def double(self) -> bool: method score (line 55) | def score(self) -> int: function builder (line 62) | def builder(v1: int, v2: int) -> Domino: class Hand (line 89) | class Hand(list): method __init__ (line 91) | def __init__(self, *args: Domino) -> None: method score (line 94) | def score(self) -> int: method rank (line 97) | def rank(self) -> None: method doubles (line 100) | def doubles(self) -> List[Domino_1]: method highest_double (line 103) | def highest_double(self) -> Optional[Domino_1]: class DominoBoneYard (line 110) | class DominoBoneYard: method __init__ (line 118) | def __init__(self, limit: int = 6) -> None: method draw (line 124) | def draw(self, n: int = 1) -> Optional[List[Domino]]: method hand_iter (line 131) | def hand_iter(self, players: int = 4) -> Iterator[Hand]: class Hand_X1 (line 175) | class Hand_X1(Hand): method __init__ (line 177) | def __init__(self, *args) -> None: method matches (line 184) | def matches(self, spots: int) -> List[Domino_1]: FILE: Chapter_16/ch16_ex1.py class Player (line 16) | class Player: method __init__ (line 18) | def __init__(self, bet: str, strategy: str, stake: int) -> None: function logged (line 31) | def logged(cls: Type) -> Type: class Player_2 (line 49) | class Player_2: method __init__ (line 52) | def __init__(self, bet: str, strategy: str, stake: int) -> None: class LoggedClassMeta (line 60) | class LoggedClassMeta(type): method __new__ (line 62) | def __new__(cls, name, bases, namespace, **kwds): class LoggedClass (line 68) | class LoggedClass(metaclass=LoggedClassMeta): class Player_3 (line 75) | class Player_3(LoggedClass): method __init__ (line 77) | def __init__(self, bet: str, strategy: str, stake: int) -> None: FILE: Chapter_16/ch16_ex10.py class WaitQueueHandler (line 22) | class WaitQueueHandler(logging.handlers.QueueHandler): method enqueue (line 24) | def enqueue(self, record): class Log_Producer_2 (line 31) | class Log_Producer_2(Log_Producer): FILE: Chapter_16/ch16_ex2.py function log_to (line 21) | def log_to(*names: str): class Player (line 39) | class Player: method __init__ (line 40) | def __init__(self, bet: str, strategy: str, stake: int) -> None: class Table (line 47) | class Table: method add_player (line 48) | def add_player(self, player: Player) -> None: FILE: Chapter_16/ch16_ex4.py class Main (line 23) | class Main(LoggedClass): method __init__ (line 25) | def __init__(self) -> None: method run (line 28) | def run(self) -> int: function demo4a (line 81) | def demo4a() -> None: function demo4b (line 102) | def demo4b() -> None: FILE: Chapter_16/ch16_ex5.py class BettingStrategy (line 62) | class BettingStrategy(LoggedClass): method bet (line 64) | def bet(self) -> int: method record_win (line 67) | def record_win(self) -> None: method record_loss (line 70) | def record_loss(self) -> None: class OneThreeTwoSix (line 74) | class OneThreeTwoSix(BettingStrategy): method __init__ (line 76) | def __init__(self) -> None: method _state (line 79) | def _state(self) -> Dict[str, int]: method bet (line 82) | def bet(self) -> int: method record_win (line 87) | def record_win(self) -> None: method record_loss (line 91) | def record_loss(self) -> None: function audited (line 99) | def audited(cls: Type) -> Type: class AuditedClassMeta (line 110) | class AuditedClassMeta(LoggedClassMeta): method __new__ (line 112) | def __new__(cls, name, bases, namespace, **kwds): class AuditedClass (line 122) | class AuditedClass(LoggedClass, metaclass=AuditedClassMeta): class Table (line 127) | class Table(AuditedClass): method bet (line 129) | def bet(self, bet: str, amount: int) -> None: FILE: Chapter_16/ch16_ex6.py class UserLogRecordFactory (line 56) | class UserLogRecordFactory: method __init__ (line 57) | def __init__(self) -> None: method __call__ (line 61) | def __call__(self, *args, **kwargs) -> logging.LogRecord: class UserLogAdapter (line 73) | class UserLogAdapter(logging.LoggerAdapter): method process (line 74) | def process(self, msg, kwargs): FILE: Chapter_16/ch16_ex7.py class Player (line 19) | class Player: method bet (line 22) | def bet(self) -> None: FILE: Chapter_16/ch16_ex8.py class TailHandler (line 24) | class TailHandler(logging.handlers.MemoryHandler): method shouldFlush (line 25) | def shouldFlush(self, record: logging.LogRecord) -> bool: FILE: Chapter_16/ch16_ex9.py class Log_Consumer_1 (line 49) | class Log_Consumer_1(multiprocessing.Process): method __init__ (line 52) | def __init__(self, queue): method run (line 60) | def run(self): class Log_Producer (line 73) | class Log_Producer(multiprocessing.Process): method __init__ (line 76) | def __init__(self, proc_id, queue): method run (line 85) | def run(self): function demo (line 92) | def demo(): FILE: Chapter_17/ch17_ex1.py class Suit (line 17) | class Suit(enum.Enum): class Card (line 24) | class Card: method __init__ (line 26) | def __init__( method __str__ (line 34) | def __str__(self) -> str: class AceCard (line 38) | class AceCard(Card): method __init__ (line 40) | def __init__(self, rank: int, suit: Suit) -> None: class FaceCard (line 44) | class FaceCard(Card): method __init__ (line 46) | def __init__(self, rank: int, suit: Suit) -> None: class LogicError (line 50) | class LogicError(Exception): function card (line 54) | def card(rank: int, suit: Suit) -> Card: class Deck1 (line 68) | class Deck1(list): method __init__ (line 70) | def __init__(self, size: int = 1) -> None: class Deck2 (line 84) | class Deck2(list): method __init__ (line 86) | def __init__( class TestCard (line 115) | class TestCard(unittest.TestCase): method setUp (line 117) | def setUp(self) -> None: method test_should_returnStr (line 120) | def test_should_returnStr(self) -> None: method test_should_getAttrValues (line 123) | def test_should_getAttrValues(self) -> None: class TestAceCard (line 130) | class TestAceCard(unittest.TestCase): method setUp (line 132) | def setUp(self) -> None: method test_should_returnStr (line 136) | def test_should_returnStr(self) -> None: method test_should_getAttrValues (line 139) | def test_should_getAttrValues(self) -> None: class TestFaceCard (line 146) | class TestFaceCard(unittest.TestCase): method setUp (line 148) | def setUp(self) -> None: method test_should_returnStr (line 152) | def test_should_returnStr(self) -> None: method test_should_getAttrValues (line 155) | def test_should_getAttrValues(self) -> None: function suite2 (line 165) | def suite2() -> unittest.TestSuite: class TestCardFactory (line 185) | class TestCardFactory(unittest.TestCase): method test_rank1_should_createAceCard (line 187) | def test_rank1_should_createAceCard(self) -> None: method test_rank2_should_createCard (line 191) | def test_rank2_should_createCard(self) -> None: method test_rank10_should_createCard (line 195) | def test_rank10_should_createCard(self) -> None: method test_rank10_should_createFaceCard (line 199) | def test_rank10_should_createFaceCard(self) -> None: method test_rank13_should_createFaceCard (line 203) | def test_rank13_should_createFaceCard(self) -> None: method test_otherRank_should_exception (line 207) | def test_otherRank_should_exception(self) -> None: function suite3 (line 217) | def suite3() -> unittest.TestSuite: class DeckEmpty (line 233) | class DeckEmpty(Exception): class Deck3 (line 237) | class Deck3(list): method __init__ (line 239) | def __init__( method deal (line 253) | def deal(self) -> Card: class TestDeckBuild (line 266) | class TestDeckBuild(unittest.TestCase): method setUp (line 268) | def setUp(self) -> None: method test_Deck3_should_build (line 273) | def test_Deck3_should_build(self) -> None: class TestDeckDeal (line 286) | class TestDeckDeal(unittest.TestCase): method setUp (line 288) | def setUp(self) -> None: method test_Deck3_should_deal (line 294) | def test_Deck3_should_deal(self) -> None: method test_empty_deck_should_exception (line 302) | def test_empty_deck_should_exception(self) -> None: function suite4 (line 312) | def suite4(): function ackermann (line 329) | def ackermann(m: int, n: int) -> int: class GameStat (line 388) | class GameStat(NamedTuple): function gamestat_iter (line 400) | def gamestat_iter(source: Iterable[Dict[str, str]]) -> Iterator[GameStat]: function rounds_final (line 405) | def rounds_final(path: Path) -> DefaultDict[int, List[int]]: class Test_Missing (line 429) | class Test_Missing(unittest.TestCase): method setUp (line 431) | def setUp(self) -> None: method test_missingFile_should_returnDefault (line 439) | def test_missingFile_should_returnDefault(self) -> None: class Test_Damaged (line 445) | class Test_Damaged(unittest.TestCase): method setUp (line 447) | def setUp(self) -> None: method test_damagedFile_should_raiseException (line 452) | def test_damagedFile_should_raiseException(self) -> None: function suite7 (line 458) | def suite7(): function float_or_none (line 491) | def float_or_none(text: str) -> Optional[float]: class Test_RTD (line 500) | class Test_RTD(unittest.TestCase): method runTest (line 502) | def runTest(self) -> None: method example (line 508) | def example( function suite9 (line 539) | def suite9(): class Test_Performance (line 559) | class Test_Performance(unittest.TestCase): method test_simpleCalc_shouldbe_fastEnough (line 561) | def test_simpleCalc_shouldbe_fastEnough(self): function suite10 (line 573) | def suite10(): FILE: Chapter_17/ch17_ex2.py function build_test_db (line 32) | def build_test_db(name="sqlite:///./data/ch17_blog.db"): class Test_Blog_Queries (line 47) | class Test_Blog_Queries(unittest.TestCase): method setUpClass (line 53) | def setUpClass() -> None: method setUp (line 90) | def setUp(self) -> None: method test_query_eqTitle_should_return1Blog (line 93) | def test_query_eqTitle_should_return1Blog(self) -> None: method test_query_likeTitle_should_return2Blog (line 99) | def test_query_likeTitle_should_return2Blog(self) -> None: method test_query_eqW42_tag_should_return2Post (line 104) | def test_query_eqW42_tag_should_return2Post(self) -> None: method test_query_eqICW_tag_should_return1Post (line 110) | def test_query_eqICW_tag_should_return1Post(self) -> None: function suite8 (line 127) | def suite8() -> unittest.TestSuite: FILE: Chapter_17/test_ch17.py class Suit (line 22) | class Suit(enum.Enum): class Card (line 29) | class Card: method __init__ (line 31) | def __init__( method __str__ (line 39) | def __str__(self) -> str: class AceCard (line 43) | class AceCard(Card): method __init__ (line 45) | def __init__(self, rank: int, suit: Suit) -> None: class FaceCard (line 49) | class FaceCard(Card): method __init__ (line 51) | def __init__(self, rank: int, suit: Suit) -> None: class LogicError (line 55) | class LogicError(Exception): function card (line 59) | def card(rank: int, suit: Suit) -> Card: class Deck1 (line 70) | class Deck1(list): method __init__ (line 72) | def __init__(self, size: int = 1) -> None: class Deck2 (line 86) | class Deck2(list): method __init__ (line 88) | def __init__( function test_card (line 116) | def test_card(): function test_ace_card (line 125) | def test_ace_card(): function test_face_card (line 134) | def test_face_card(): function test_card_factory (line 153) | def test_card_factory(): class DeckEmpty (line 183) | class DeckEmpty(Exception): class Deck3 (line 187) | class Deck3(list): method __init__ (line 189) | def __init__(self, size=1, random=random.Random(), card_factory=card): method deal (line 196) | def deal(self): function deck_context (line 210) | def deck_context(): function test_deck_build (line 223) | def test_deck_build(deck_context): function test_deck_deal (line 237) | def test_deck_deal(deck_context): function ackermann (line 258) | def ackermann(m, n): class GameStat (line 292) | class GameStat(NamedTuple): function gamestat_iter (line 302) | def gamestat_iter(iterator): function rounds_final (line 307) | def rounds_final(path: Path): function no_file_path (line 331) | def no_file_path(): function test_missing (line 341) | def test_missing(no_file_path): function damaged_file_path (line 347) | def damaged_file_path(): function test_damaged (line 355) | def test_damaged(damaged_file_path): function built_test_db (line 379) | def built_test_db(name="sqlite:///./data/ch17_blog.db"): function db_session_maker (line 390) | def db_session_maker(): function test_database (line 428) | def test_database(db_session_maker): function float_or_none (line 465) | def float_or_none(text): function rtd_example (line 479) | def rtd_example(request): function test_rtd (line 483) | def test_rtd(rtd_example): function test_performance (line 513) | def test_performance(): FILE: Chapter_18/ch18_ex1.py function get_options_1 (line 23) | def get_options_1( function test_get_config_1 (line 151) | def test_get_config_1(capsys): FILE: Chapter_18/ch18_ex2.py function nint (line 28) | def nint(x: Optional[str]) -> Optional[int]: function get_options_2 (line 34) | def get_options_2(argv: List[str] = sys.argv[1:]) -> argparse.Namespace: FILE: Chapter_18/ch18_ex3.py function simulate_blackjack (line 36) | def simulate_blackjack(config: argparse.Namespace) -> None: class Build_Config (line 90) | class Build_Config: method __init__ (line 92) | def __init__(self, argv: List[str]) -> None: method __enter__ (line 95) | def __enter__(self) -> argparse.Namespace: method __exit__ (line 98) | def __exit__(self, *exc) -> None: class Setup_Logging (line 121) | class Setup_Logging: method __init__ (line 123) | def __init__(self, stream=sys.stderr, disable_existing_loggers=False) ... method __enter__ (line 143) | def __enter__(self) -> "Setup_Logging": method __exit__ (line 147) | def __exit__(self, *exc) -> None: class ClassLogger (line 157) | class ClassLogger: method work (line 160) | def work(self) -> None: class InstanceLogger (line 165) | class InstanceLogger: method __init__ (line 167) | def __init__(self, name: str) -> None: method work (line 170) | def work(self) -> None: function simulate_blackjack_betting (line 219) | def simulate_blackjack_betting(config: argparse.Namespace) -> None: class Command (line 248) | class Command: method __init__ (line 257) | def __init__(self) -> None: method configure (line 260) | def configure(self, namespace: argparse.Namespace) -> None: method run (line 263) | def run(self) -> None: class Simulate_Command (line 268) | class Simulate_Command(Command): method run (line 278) | def run(self) -> None: class Analyze_Command (line 320) | class Analyze_Command(Command): method run (line 322) | def run(self) -> None: class Command_Sequence (line 343) | class Command_Sequence(Command): method __init__ (line 349) | def __init__(self) -> None: method configure (line 352) | def configure(self, config: argparse.Namespace) -> None: method run (line 356) | def run(self) -> None: class Simulate_and_Analyze (line 361) | class Simulate_and_Analyze(Command_Sequence): class ForAllBets_Simulate (line 378) | class ForAllBets_Simulate(Command): method run (line 380) | def run(self) -> None: FILE: Chapter_19/some_algorithm/abstraction.py class AbstractSomeAlgorithm (line 11) | class AbstractSomeAlgorithm: FILE: Chapter_19/some_algorithm/long_version.py class Implementation_Long (line 16) | class Implementation_Long(AbstractSomeAlgorithm): method value (line 21) | def value(self) -> int: FILE: Chapter_19/some_algorithm/short_version.py class Implementation_Short (line 16) | class Implementation_Short(AbstractSomeAlgorithm): method value (line 21) | def value(self) -> int: FILE: Chapter_19/tests/test_all.py class TestSomeAlgorithm (line 17) | class TestSomeAlgorithm(unittest.TestCase): method test_import_should_see_value (line 19) | def test_import_should_see_value(self): FILE: Chapter_2/ch02_ex1.py class Card (line 12) | class Card: method __init__ (line 14) | def __init__(self, rank: str, suit: str) -> None: method _points (line 19) | def _points(self) -> Tuple[int, int]: class AceCard (line 23) | class AceCard(Card): method _points (line 25) | def _points(self) -> Tuple[int, int]: class FaceCard (line 29) | class FaceCard(Card): method _points (line 31) | def _points(self) -> Tuple[int, int]: FILE: Chapter_2/ch02_ex2.py class Card (line 16) | class Card: method __init__ (line 19) | def __init__(self, rank: str, suit: Any) -> None: method __eq__ (line 24) | def __eq__(self, other: Any) -> bool: method __repr__ (line 32) | def __repr__(self) -> str: method __str__ (line 35) | def __str__(self) -> str: method _points (line 38) | def _points(self) -> Tuple[int, int]: class AceCard (line 42) | class AceCard(Card): method _points (line 45) | def _points(self) -> Tuple[int, int]: class FaceCard (line 49) | class FaceCard(Card): method _points (line 51) | def _points(self) -> Tuple[int, int]: class Suit (line 74) | class Suit(str, Enum): FILE: Chapter_2/ch02_ex3.py function card (line 16) | def card(rank: int, suit: Suit) -> Card: function card2 (line 51) | def card2(rank: int, suit: Suit) -> Card: function card3 (line 70) | def card3(rank: int, suit: Suit) -> Card: function card4 (line 108) | def card4(rank: int, suit: Suit) -> Card: function card5 (line 126) | def card5(rank: int, suit: Suit) -> Card: function card6 (line 145) | def card6(rank: int, suit: Suit) -> Card: function card7 (line 176) | def card7(rank: int, suit: Suit) -> Card: class CardFactory (line 203) | class CardFactory: method rank (line 205) | def rank(self, rank: int) -> "CardFactory": method suit (line 216) | def suit(self, suit: Suit) -> Card: FILE: Chapter_2/ch02_ex4.py class Card2 (line 20) | class Card2: method __init__ (line 23) | def __init__(self, rank: int, suit: Suit) -> None: method __eq__ (line 29) | def __eq__(self, other: Any) -> bool: method __repr__ (line 37) | def __repr__(self) -> str: class NumberCard2 (line 41) | class NumberCard2(Card2): method __init__ (line 43) | def __init__(self, rank: int, suit: Suit) -> None: class AceCard2 (line 49) | class AceCard2(Card2): method __init__ (line 51) | def __init__(self, rank: int, suit: Suit) -> None: class FaceCard2 (line 57) | class FaceCard2(Card2): method __init__ (line 59) | def __init__(self, rank: int, suit: Suit) -> None: function card9 (line 65) | def card9(rank: int, suit: Suit) -> Card2: class Card3 (line 91) | class Card3: method __init__ (line 93) | def __init__(self, rank: str, suit: Suit, hard: int, soft: int) -> None: method __eq__ (line 99) | def __eq__(self, other: Any) -> bool: class NumberCard3 (line 108) | class NumberCard3(Card3): method __init__ (line 110) | def __init__(self, rank: int, suit: Suit) -> None: class AceCard3 (line 114) | class AceCard3(Card3): method __init__ (line 116) | def __init__(self, rank: int, suit: Suit) -> None: class FaceCard3 (line 120) | class FaceCard3(Card3): method __init__ (line 122) | def __init__(self, rank: int, suit: Suit) -> None: function card10 (line 127) | def card10(rank: int, suit: Suit) -> Card3: FILE: Chapter_2/ch02_ex5.py class Deck (line 34) | class Deck: method __init__ (line 36) | def __init__(self) -> None: method pop (line 40) | def pop(self) -> Card: class Deck2 (line 56) | class Deck2(list): method __init__ (line 58) | def __init__(self) -> None: class Deck3 (line 78) | class Deck3(list): method __init__ (line 80) | def __init__(self, decks: int = 1) -> None: class Deck3a (line 99) | class Deck3a(list): method __init__ (line 101) | def __init__(self, decks: int = 1) -> None: class Hand (line 126) | class Hand: method __init__ (line 128) | def __init__(self, dealer_card: Card) -> None: method hard_total (line 132) | def hard_total(self) -> int: method soft_total (line 135) | def soft_total(self) -> int: method __repr__ (line 138) | def __repr__(self) -> str: class Hand2 (line 157) | class Hand2: method __init__ (line 159) | def __init__(self, dealer_card: Card, *cards: Card) -> None: method card_append (line 163) | def card_append(self, card: Card) -> None: method hard_total (line 166) | def hard_total(self) -> int: method soft_total (line 169) | def soft_total(self) -> int: method __repr__ (line 172) | def __repr__(self) -> str: class Hand3 (line 188) | class Hand3: method __init__ (line 191) | def __init__(self, arg1: "Hand3") -> None: method __init__ (line 195) | def __init__(self, arg1: Card, arg2: Card, arg3: Card) -> None: method __init__ (line 198) | def __init__( method __repr__ (line 218) | def __repr__(self) -> str: class Hand4 (line 246) | class Hand4: method __init__ (line 249) | def __init__(self, arg1: "Hand4") -> None: method __init__ (line 253) | def __init__(self, arg1: "Hand4", arg2: Card, *, split: int) -> None: method __init__ (line 257) | def __init__(self, arg1: Card, arg2: Card, arg3: Card) -> None: method __init__ (line 260) | def __init__( method __str__ (line 286) | def __str__(self) -> str: class Hand5 (line 304) | class Hand5: method __init__ (line 306) | def __init__(self, dealer_card: Card, *cards: Card) -> None: method freeze (line 311) | def freeze(other) -> "Hand5": method split (line 316) | def split(other, card0, card1) -> Tuple["Hand5", "Hand5"]: method __str__ (line 321) | def __str__(self) -> str: class BettingStrategy (line 341) | class BettingStrategy: method bet (line 343) | def bet(self) -> int: method record_win (line 346) | def record_win(self) -> None: method record_loss (line 349) | def record_loss(self) -> None: class Flat (line 353) | class Flat(BettingStrategy): method bet (line 355) | def bet(self) -> int: class BettingStrategy2 (line 369) | class BettingStrategy2(metaclass=abc.ABCMeta): method bet (line 372) | def bet(self) -> int: method record_win (line 375) | def record_win(self): method record_loss (line 378) | def record_loss(self): class GameStrategy (line 385) | class GameStrategy: method insurance (line 387) | def insurance(self, hand: Hand) -> bool: method split (line 390) | def split(self, hand: Hand) -> bool: method double (line 393) | def double(self, hand: Hand) -> bool: method hit (line 396) | def hit(self, hand: Hand) -> bool: class Table (line 424) | class Table: method __init__ (line 426) | def __init__(self) -> None: method place_bet (line 429) | def place_bet(self, amount: int) -> None: method get_hand (line 432) | def get_hand(self) -> Hand2: method can_insure (line 444) | def can_insure(self, hand: Hand) -> bool: class Player (line 451) | class Player: method __init__ (line 453) | def __init__( method game (line 463) | def game(self): class Player2 (line 490) | class Player2(Player): method __init__ (line 492) | def __init__(self, **kw) -> None: method game (line 499) | def game(self) -> None: class Player2x (line 518) | class Player2x(Player): method __init__ (line 520) | def __init__(self, **kw) -> None: method game (line 527) | def game(self) -> None: class Player3 (line 552) | class Player3(Player): method __init__ (line 554) | def __init__( class ValidPlayer (line 595) | class ValidPlayer: method __init__ (line 597) | def __init__(self, table, bet_strategy, game_strategy): class Player4 (line 617) | class Player4: method __init__ (line 619) | def __init__( FILE: Chapter_20/combo.py function combinations (line 41) | def combinations(n: int, k: int) -> int: FILE: Chapter_20/src/ch20_ex1.py class Suit (line 58) | class Suit(str, Enum): class Card (line 68) | class Card: method __init__ (line 79) | def __init__( method __str__ (line 94) | def __str__(self) -> str: method __repr__ (line 97) | def __repr__(self) -> str: class FaceCard (line 101) | class FaceCard(Card): method __str__ (line 107) | def __str__(self) -> str: class AceCard (line 111) | class AceCard(Card): method __str__ (line 116) | def __str__(self) -> str: function card (line 120) | def card(rank: int, suit: Suit) -> Card: FILE: Chapter_20/tests/test_ch20.py function test_card_factory (line 15) | def test_card_factory(): FILE: Chapter_3/ch03_ex1.py class Card (line 25) | class Card: method __init__ (line 28) | def __init__(self, rank: str, suit: "Suit", hard: int, soft: int) -> N... method __repr__ (line 34) | def __repr__(self) -> str: method __str__ (line 37) | def __str__(self) -> str: class NumberCard (line 41) | class NumberCard(Card): method __init__ (line 43) | def __init__(self, rank: int, suit: "Suit") -> None: class AceCard (line 47) | class AceCard(Card): method __init__ (line 50) | def __init__(self, rank: int, suit: "Suit") -> None: class FaceCard (line 54) | class FaceCard(Card): method __init__ (line 56) | def __init__(self, rank: int, suit: "Suit") -> None: class Suit (line 61) | class Suit(str, Enum): class Card2 (line 99) | class Card2: method __init__ (line 102) | def __init__(self, rank: str, suit: "Suit", hard: int, soft: int) -> N... method __repr__ (line 108) | def __repr__(self) -> str: method __str__ (line 111) | def __str__(self) -> str: method __eq__ (line 114) | def __eq__(self, other: Any) -> bool: method __hash__ (line 120) | def __hash__(self) -> int: method __format__ (line 123) | def __format__(self, format_spec: str) -> str: method __bytes__ (line 133) | def __bytes__(self) -> bytes: class NumberCard2 (line 142) | class NumberCard2(Card2): method __init__ (line 144) | def __init__(self, rank: int, suit: "Suit") -> None: class AceCard2 (line 148) | class AceCard2(Card2): method __init__ (line 151) | def __init__(self, rank: int, suit: "Suit") -> None: class FaceCard2 (line 155) | class FaceCard2(Card2): method __init__ (line 157) | def __init__(self, rank: int, suit: "Suit") -> None: function card2 (line 162) | def card2(rank: int, suit: Suit) -> Card2: class Card3 (line 202) | class Card3: method __init__ (line 205) | def __init__(self, rank: str, suit: "Suit", hard: int, soft: int) -> N... method __repr__ (line 211) | def __repr__(self) -> str: method __str__ (line 214) | def __str__(self) -> str: method __eq__ (line 217) | def __eq__(self, other: Any) -> bool: class AceCard3 (line 226) | class AceCard3(Card3): method __init__ (line 229) | def __init__(self, rank: int, suit: "Suit") -> None: class NumberCard3 (line 233) | class NumberCard3(Card3): method __init__ (line 235) | def __init__(self, rank: int, suit: "Suit") -> None: class FaceCard3 (line 239) | class FaceCard3(Card3): method __init__ (line 241) | def __init__(self, rank: int, suit: "Suit") -> None: FILE: Chapter_3/ch03_ex2.py class Suit (line 17) | class Suit(str, Enum): class Card (line 24) | class Card(NamedTuple): method __str__ (line 28) | def __str__(self) -> str: method insure (line 32) | def insure(self) -> bool: method hard (line 36) | def hard(self) -> int: method soft (line 41) | def soft(self) -> int: method _points (line 45) | def _points(self) -> Tuple[int, int]: class NumberCard (line 49) | class NumberCard(Card): method _points (line 51) | def _points(self) -> Tuple[int, int]: class AceCard (line 55) | class AceCard(Card): method insure (line 58) | def insure(self) -> bool: method _points (line 61) | def _points(self) -> Tuple[int, int]: class FaceCard (line 65) | class FaceCard(Card): method _points (line 67) | def _points(self) -> Tuple[int, int]: function card (line 71) | def card(rank: int, suit: Suit) -> Card: FILE: Chapter_3/ch03_ex3.py class Hand (line 22) | class Hand: method __init__ (line 24) | def __init__(self, dealer_card: Card2, *cards: Card2) -> None: method __str__ (line 28) | def __str__(self) -> str: method __repr__ (line 31) | def __repr__(self) -> str: method __format__ (line 35) | def __format__(self, spec: str) -> str: method __eq__ (line 40) | def __eq__(self, other: Any) -> bool: method __lt__ (line 51) | def __lt__(self, other: Any) -> bool: method __le__ (line 59) | def __le__(self, other: Any) -> bool: method total (line 69) | def total(self) -> int: class FrozenHand (line 77) | class FrozenHand(Hand): method __init__ (line 79) | def __init__(self, *args, **kw) -> None: method __hash__ (line 89) | def __hash__(self) -> int: class Deck (line 93) | class Deck(list): method __init__ (line 95) | def __init__(self) -> None: FILE: Chapter_3/ch03_ex4.py class Deck (line 17) | class Deck(list): method __init__ (line 19) | def __init__(self) -> None: function card_from_bytes (line 160) | def card_from_bytes(buffer: bytes) -> Card2: class BlackJackCard_p (line 214) | class BlackJackCard_p: method __init__ (line 216) | def __init__(self, rank: int, suit: Suit) -> None: method __lt__ (line 220) | def __lt__(self, other: Any) -> bool: method __str__ (line 224) | def __str__(self) -> str: class BlackJackCard (line 256) | class BlackJackCard: method __init__ (line 258) | def __init__(self, rank: int, suit: Suit, hard: int, soft: int) -> None: method __lt__ (line 264) | def __lt__(self, other: Any) -> bool: method __le__ (line 269) | def __le__(self, other: Any) -> bool: method __gt__ (line 275) | def __gt__(self, other: Any) -> bool: method __ge__ (line 280) | def __ge__(self, other: Any) -> bool: method __eq__ (line 286) | def __eq__(self, other: Any) -> bool: method __ne__ (line 292) | def __ne__(self, other: Any) -> bool: method __str__ (line 298) | def __str__(self) -> str: method __repr__ (line 301) | def __repr__(self) -> str: class Ace21Card (line 307) | class Ace21Card(BlackJackCard): method __init__ (line 309) | def __init__(self, rank: int, suit: Suit) -> None: method __str__ (line 312) | def __str__(self) -> str: method __repr__ (line 315) | def __repr__(self) -> str: class Face21Card (line 319) | class Face21Card(BlackJackCard): method __init__ (line 323) | def __init__(self, rank: int, suit: Suit) -> None: method __str__ (line 326) | def __str__(self) -> str: method __repr__ (line 329) | def __repr__(self) -> str: class Number21Card (line 333) | class Number21Card(BlackJackCard): method __init__ (line 335) | def __init__(self, rank: int, suit: Suit) -> None: function card21 (line 339) | def card21(rank: int, suit: Suit) -> BlackJackCard: class Noisy (line 418) | class Noisy: method __del__ (line 420) | def __del__(self) -> None: class Parent (line 447) | class Parent: method __init__ (line 449) | def __init__(self, *children: 'Child') -> None: method __del__ (line 454) | def __del__(self) -> None: class Child (line 460) | class Child: method __init__ (line 462) | def __init__(self, id: str) -> None: method __del__ (line 466) | def __del__(self) -> None: class Parent2 (line 497) | class Parent2: method __init__ (line 499) | def __init__(self, *children: 'Child2') -> None: method __del__ (line 504) | def __del__(self) -> None: class Child2 (line 509) | class Child2: method __init__ (line 511) | def __init__(self, id: str) -> None: method __del__ (line 515) | def __del__(self) -> None: class Float_Fail (line 534) | class Float_Fail(float): method __init__ (line 536) | def __init__(self, value: float, unit: str) -> None: class Float_Units (line 562) | class Float_Units(float): method __new__ (line 564) | def __new__(cls, value, unit): class Float_Units_Ugly (line 571) | class Float_Units_Ugly(float): method __new__ (line 575) | def __new__(cls: Type, value: SupportsFloat, unit: str) -> 'Float_Unit... FILE: Chapter_3/ch03_ex5.py class Float_Fail (line 23) | class Float_Fail(float): method __init__ (line 25) | def __init__(self, value: float, unit: str) -> None: class Float_Units (line 52) | class Float_Units(float): method __new__ (line 54) | def __new__(cls, value, unit): class Float_Units_Ugly (line 75) | class Float_Units_Ugly(float): method __new__ (line 79) | def __new__(cls: Type, value: SupportsFloat, unit: str) -> "Float_Unit... class AddUnitMeta (line 99) | class AddUnitMeta(type): method __new__ (line 101) | def __new__( class Float_Units2 (line 109) | class Float_Units2(float, metaclass=AddUnitMeta): method withUnit (line 111) | def withUnit(self, unit): class LoggedMeta (line 132) | class LoggedMeta(type): method __new__ (line 134) | def __new__( class Logged (line 142) | class Logged(metaclass=LoggedMeta): class SomeApplicationClass (line 146) | class SomeApplicationClass(Logged): method __init__ (line 148) | def __init__(self, v1: int, v2: int) -> None: FILE: Chapter_4/ch04_ex1.py class Suit (line 24) | class Suit(str, Enum): class BlackJackCard (line 31) | class BlackJackCard: method __init__ (line 38) | def __init__(self, rank: str, suit: "Suit", hard: int, soft: int) -> N... method __repr__ (line 44) | def __repr__(self) -> str: method __str__ (line 47) | def __str__(self) -> str: method __lt__ (line 57) | def __lt__(self, other: Any) -> bool: method __le__ (line 63) | def __le__(self, other: Any) -> bool: method __eq__ (line 70) | def __eq__(self, other: Any) -> bool: class Ace21Card (line 79) | class Ace21Card(BlackJackCard): method __init__ (line 82) | def __init__(self, rank: int, suit: Suit) -> None: method __repr__ (line 85) | def __repr__(self) -> str: class Face21Card (line 89) | class Face21Card(BlackJackCard): method __init__ (line 92) | def __init__(self, rank: int, suit: Suit) -> None: method __repr__ (line 96) | def __repr__(self) -> str: class Number21Card (line 101) | class Number21Card(BlackJackCard): method __init__ (line 104) | def __init__(self, rank: int, suit: Suit) -> None: method __repr__ (line 107) | def __repr__(self) -> str: function card21 (line 111) | def card21(rank: int, suit: Suit) -> BlackJackCard: function compare (line 122) | def compare(a: Any, b: Any) -> None: class Deck (line 172) | class Deck(list): method __init__ (line 174) | def __init__( class AceCard2 (line 186) | class AceCard2(NamedTuple): method __str__ (line 192) | def __str__(self) -> str: class FaceCard2 (line 196) | class FaceCard2(NamedTuple): method __str__ (line 202) | def __str__(self) -> str: class NumberCard2 (line 206) | class NumberCard2(NamedTuple): method __str__ (line 212) | def __str__(self) -> str: function card2 (line 216) | def card2(rank: int, suit: Suit) -> Union[AceCard2, FaceCard2, NumberCar... class AceCard3 (line 287) | class AceCard3: class FaceCard3 (line 295) | class FaceCard3: class NumberCard3 (line 303) | class NumberCard3: function card3 (line 310) | def card3(rank, suit) -> Union[AceCard3, FaceCard3, NumberCard3]: FILE: Chapter_4/ch04_ex2.py class Hand (line 21) | class Hand: method __init__ (line 23) | def __init__( method __str__ (line 31) | def __str__(self) -> str: method __repr__ (line 34) | def __repr__(self) -> str: method card (line 42) | def card(self) -> List[BlackJackCard]: method card (line 46) | def card(self, aCard: BlackJackCard) -> None: method card (line 50) | def card(self) -> None: method split (line 53) | def split(self, deck: Deck) -> "Hand": class Hand_Lazy (line 63) | class Hand_Lazy(Hand): method total (line 66) | def total(self) -> int: method card (line 74) | def card(self) -> List[BlackJackCard]: method card (line 78) | def card(self, aCard: BlackJackCard) -> None: method card (line 82) | def card(self) -> None: class Hand_Eager (line 107) | class Hand_Eager(Hand): method __init__ (line 109) | def __init__( method card (line 125) | def card(self) -> List[BlackJackCard]: method card (line 129) | def card(self, aCard: BlackJackCard) -> None: method card (line 136) | def card(self) -> None: method _set_total (line 143) | def _set_total(self) -> None: FILE: Chapter_4/ch04_ex3.py class RateTimeDistance (line 22) | class RateTimeDistance: method __post_init__ (line 28) | def __post_init__(self) -> None: class RTD_Dynamic (line 57) | class RTD_Dynamic: method __init__ (line 59) | def __init__(self) -> None: method __repr__ (line 68) | def __repr__(self) -> str: method __setattr__ (line 78) | def __setattr__(self, name: str, value: float) -> None: class PersistentState (line 122) | class PersistentState: class StateManager (line 127) | class StateManager: method __init__ (line 130) | def __init__(self, base: Path) -> None: method __get__ (line 133) | def __get__(self, instance: PersistentState, owner: Type) -> Path: class PersistentClass (line 141) | class PersistentClass(PersistentState): method __init__ (line 144) | def __init__(self, a: int, b: float) -> None: method calculate (line 150) | def calculate(self, c: float) -> float: method __str__ (line 155) | def __str__(self) -> str: class Conversion (line 172) | class Conversion: method __get__ (line 177) | def __get__(self, instance: Any, owner: type) -> float: method __set__ (line 180) | def __set__(self, instance: Any, value: float) -> None: class Standard (line 184) | class Standard(Conversion): class Speed (line 189) | class Speed(Conversion): class KPH (line 193) | class KPH(Standard, Speed): class Knots (line 197) | class Knots(Speed): class MPH (line 201) | class MPH(Speed): class Trip (line 205) | class Trip: method __init__ (line 210) | def __init__( method __str__ (line 228) | def __str__(self) -> str: FILE: Chapter_4/ch04_ex4.py class Card (line 14) | class Card: method __init__ (line 17) | def __init__(cls, rank: int, suit: Suit) -> None: method __setattr__ (line 20) | def __setattr__(self, name: str, value: Any) -> None: method __getattr__ (line 23) | def __getattr__(self, name: str) -> Any: class RTD_Solver (line 87) | class RTD_Solver: method __init__ (line 89) | def __init__( method __getattr__ (line 99) | def __getattr__(self, name: str) -> float: class SuperSecret (line 120) | class SuperSecret: method __init__ (line 122) | def __init__(self, hidden: Any, exposed: Any) -> None: method __getattribute__ (line 126) | def __getattribute__(self, item: str): FILE: Chapter_4/ch04_ex5.py class RTD (line 16) | class RTD: method compute (line 21) | def compute(self) -> "RTD": class Suit (line 44) | class Suit(str, Enum): class Card (line 52) | class Card: method points (line 57) | def points(self) -> int: class Ace (line 61) | class Ace(Card): method points (line 64) | def points(self) -> int: class Face (line 68) | class Face(Card): method points (line 71) | def points(self) -> int: function deck (line 75) | def deck() -> Iterator[Card]: FILE: Chapter_5/ch05_ex1.py class Card (line 18) | class Card: class Hand (line 22) | class Hand(list): method __init__ (line 23) | def __init__(self, *cards: Card) -> None: class AbstractBettingStrategy (line 27) | class AbstractBettingStrategy(metaclass=ABCMeta): method bet (line 30) | def bet(self, hand: Hand) -> int: method record_win (line 34) | def record_win(self, hand: Hand) -> None: method record_loss (line 38) | def record_loss(self, hand: Hand) -> None: class AbstractBettingStrategy2 (line 41) | class AbstractBettingStrategy2(ABC): method bet (line 44) | def bet(self, hand: Hand) -> int: method record_win (line 48) | def record_win(self, hand: Hand) -> None: method record_loss (line 52) | def record_loss(self, hand: Hand) -> None: method __subclasshook__ (line 56) | def __subclasshook__(cls, subclass: type) -> bool: class Simple (line 96) | class Simple(AbstractBettingStrategy): method bet (line 98) | def bet(self, hand: Hand) -> int: method record_win (line 101) | def record_win(self, hand: Hand) -> None: method record_loss (line 104) | def record_loss(self, hand: Hand) -> None: class LikeAbstract (line 113) | class LikeAbstract: method aMethod (line 114) | def aMethod(self, arg: int) -> int: class LikeConcrete (line 119) | class LikeConcrete(LikeAbstract): method aMethod (line 120) | def aMethod(self, arg1: str, arg2: Tuple[int, int]) -> Iterator[Any]: FILE: Chapter_6/ch06_ex1.py class Power1 (line 18) | class Power1: method __call__ (line 20) | def __call__(self, x: int, n: int) -> int: class Power2 (line 37) | class Power2(CallableClass): # type: ignore method __call_ (line 39) | def __call_(self, x: int, n: int) -> int: class Power3 (line 58) | class Power3: method __call_ (line 60) | def __call_(self, x: int, n: int) -> int: class Power4 (line 81) | class Power4: method __call__ (line 83) | def __call__(self, x: int, n: int) -> int: class Power4i (line 103) | class Power4i: method __call__ (line 105) | def __call__(self, x: int, n: int) -> int: class Power5 (line 128) | class Power5: method __init__ (line 130) | def __init__(self) -> None: method __call__ (line 133) | def __call__(self, x: int, n: int) -> int: function pow6 (line 157) | def pow6(x: int, n: int) -> int: function performance (line 172) | def performance() -> None: class BettingStrategy (line 239) | class BettingStrategy: method __init__ (line 241) | def __init__(self) -> None: method win (line 246) | def win(self) -> int: method win (line 250) | def win(self, value: int) -> None: method loss (line 255) | def loss(self) -> int: method loss (line 259) | def loss(self, value: int) -> None: method __call__ (line 262) | def __call__(self) -> int: class BettingMartingale (line 278) | class BettingMartingale(BettingStrategy): method __init__ (line 280) | def __init__(self) -> None: method win (line 286) | def win(self) -> int: method win (line 290) | def win(self, value: int) -> None: method loss (line 295) | def loss(self) -> int: method loss (line 299) | def loss(self, value: int) -> None: method __call__ (line 303) | def __call__(self) -> int: class BettingMartingale2 (line 326) | class BettingMartingale2(BettingStrategy): method __init__ (line 328) | def __init__(self) -> None: method __setattr__ (line 333) | def __setattr__(self, name: str, value: int) -> None: method __call__ (line 340) | def __call__(self) -> int: FILE: Chapter_6/ch06_ex2.py function slow (line 17) | def slow(source="itmaybeahack.com.bkup-Feb-2012.gz") -> int: class Debugging (line 88) | class Debugging: method __init__ (line 90) | def __init__(self, aName=None): method __enter__ (line 93) | def __enter__(self): method __exit__ (line 97) | def __exit__(self, exc_type, exc_value, traceback): class KnownSequence (line 133) | class KnownSequence: method __init__ (line 135) | def __init__(self, seed: int = 0) -> None: method __enter__ (line 138) | def __enter__(self) -> 'KnownSequence': method __exit__ (line 143) | def __exit__( class Suit (line 172) | class Suit(Enum): class Card (line 178) | class Card(NamedTuple): class Deck (line 182) | class Deck(list): method __init__ (line 184) | def __init__(self, size: int = 1) -> None: class Deterministic_Deck (line 194) | class Deterministic_Deck: method __init__ (line 196) | def __init__(self, *args, **kw) -> None: method __enter__ (line 200) | def __enter__(self) -> Deck: method __exit__ (line 205) | def __exit__( class Deck2 (line 236) | class Deck2(list, KnownSequence): method __init__ (line 238) | def __init__(self, size: int = 1) -> None: method pop (line 246) | def pop(self, *args, **kw) -> Card: class Updating (line 275) | class Updating: method __init__ (line 277) | def __init__(self, target: Path) -> None: method __enter__ (line 281) | def __enter__(self) -> None: method __exit__ (line 292) | def __exit__( function some_update (line 312) | def some_update(important_path): FILE: Chapter_7/ch07_ex1.py class Suit (line 29) | class Suit(str, Enum): class BlackjackCard_T (line 46) | class BlackjackCard_T(NamedTuple): method is_ace (line 51) | def is_ace(self) -> bool: function card (line 55) | def card(rank: int, suit: Suit) -> BlackjackCard: function card_t (line 70) | def card_t(rank: int, suit: Suit) -> BlackjackCard_T: class AceCard (line 99) | class AceCard(BlackjackCard): method is_ace (line 100) | def is_ace(self) -> bool: class AceCard_T (line 103) | class AceCard_T(BlackjackCard_T): method is_ace (line 104) | def is_ace(self) -> bool: class Card (line 145) | class Card(NamedTuple): class MultiDeck (line 154) | class MultiDeck(list): method __init__ (line 158) | def __init__(self, size: int = 5) -> None: function get_options (line 190) | def get_options(argv: List[str] = sys.argv[1:]) -> ChainMap: function dice_examples (line 335) | def dice_examples(n: int=12, seed: Any=None) -> DefaultDict[int, List]: function value_iterator (line 361) | def value_iterator(count=100, seed=4000) -> Iterable[str]: function freq_ordered (line 372) | def freq_ordered(values: Iterable[T]) -> Dict[int, List[T]]: function bag_demo (line 423) | def bag_demo() -> None: FILE: Chapter_7/ch07_ex2.py function mean (line 18) | def mean(outcomes: List[float]) -> float: function stdev (line 22) | def stdev(outcomes: List[float]) -> float: class StatsList (line 40) | class StatsList(list): method __init__ (line 42) | def __init__(self, iterable: Optional[Iterable[float]]) -> None: method mean (line 46) | def mean(self) -> float: method stdev (line 50) | def stdev(self) -> float: function data_gen (line 71) | def data_gen() -> int: function demo_statslist (line 75) | def demo_statslist() -> None: class Explore (line 89) | class Explore(list): method __getitem__ (line 92) | def __getitem__(self, index): class StatsList2 (line 117) | class StatsList2(list): method __init__ (line 120) | def __init__(self, iterable: Optional[Iterable[float]]) -> None: method _new (line 128) | def _new(self, value: float) -> None: method _rmv (line 133) | def _rmv(self, value: float) -> None: method insert (line 138) | def insert(self, index: int, value: float) -> None: method pop (line 142) | def pop(self, index: int = 0) -> None: method append (line 147) | def append(self, value: float) -> None: method extend (line 151) | def extend(self, sequence: Iterable[float]) -> None: method remove (line 156) | def remove(self, value: float) -> None: method __iadd__ (line 160) | def __iadd__(self, sequence: Iterable[float]) -> "StatsList2": method __add__ (line 165) | def __add__(self, sequence: Iterable[float]) -> "StatsList2": method mean (line 176) | def mean(self) -> float: method stdev (line 180) | def stdev(self) -> float: method __setitem__ (line 184) | def __setitem__(self, index: int, value: float) -> None: method __setitem__ (line 188) | def __setitem__(self, index: slice, value: Iterable[float]) -> None: method __setitem__ (line 191) | def __setitem__(self, index, value) -> None: method __delitem__ (line 206) | def __delitem__(self, index: Union[int, slice]) -> None: class StatsList3 (line 295) | class StatsList3: method __init__ (line 297) | def __init__(self) -> None: method append (line 303) | def append(self, value: float) -> None: method __getitem__ (line 311) | def __getitem__(self, index: int) -> float: method mean (line 315) | def mean(self) -> float: method stdev (line 319) | def stdev(self) -> float: class StatsCounter (line 340) | class StatsCounter(Counter): method mean (line 343) | def mean(self) -> float: method stdev (line 349) | def stdev(self) -> float: method median (line 356) | def median(self) -> Any: method median2 (line 361) | def median2(self) -> Optional[float]: FILE: Chapter_7/ch07_ex3.py class Comparable (line 31) | class Comparable(metaclass=ABCMeta): method __lt__ (line 34) | def __lt__(self, other: Any) -> bool: method __ge__ (line 37) | def __ge__(self, other: Any) -> bool: class TreeNode (line 45) | class TreeNode: method __init__ (line 51) | def __init__( method parent (line 66) | def parent(self) -> Optional["TreeNode"]: method parent (line 70) | def parent(self, value: "TreeNode") -> None: method __repr__ (line 73) | def __repr__(self) -> str: method find (line 76) | def find(self, item: Comparable) -> "TreeNode": method __iter__ (line 88) | def __iter__(self) -> Iterator[Comparable]: method add (line 96) | def add(self, item: Comparable) -> None: method remove (line 113) | def remove(self, item: Comparable) -> None: method _least (line 138) | def _least(self) -> "TreeNode": method _replace (line 143) | def _replace(self, new: Optional["TreeNode"] = None) -> None: class Tree (line 153) | class Tree(collections.abc.MutableSet): method __init__ (line 155) | def __init__(self, source: Iterable[Comparable] = None) -> None: method add (line 163) | def add(self, item: Comparable) -> None: method discard (line 167) | def discard(self, item: Comparable) -> None: method __contains__ (line 177) | def __contains__(self, item: Any) -> bool: method __iter__ (line 184) | def __iter__(self) -> Iterator[Comparable]: method __len__ (line 190) | def __len__(self) -> int: FILE: Chapter_7/ch07_ex4.py function performance (line 17) | def performance() -> None: FILE: Chapter_8/ch08_ex1.py function trace (line 16) | def trace(frame, event, arg): class NoisyFloat (line 24) | class NoisyFloat(float): method __add__ (line 26) | def __add__(self, other: float) -> 'NoisyFloat': method __radd__ (line 30) | def __radd__(self, other: float) -> 'NoisyFloat': class FixedPoint (line 51) | class FixedPoint(numbers.Rational): method __init__ (line 54) | def __init__(self, value: Union['FixedPoint', int, float], scale: int ... method __str__ (line 71) | def __str__(self) -> str: method __repr__ (line 74) | def __repr__(self) -> str: method __format__ (line 77) | def __format__(self, specification: str) -> str: method numerator (line 82) | def numerator(self) -> int: method denominator (line 85) | def denominator(self) -> int: method __add__ (line 88) | def __add__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __sub__ (line 99) | def __sub__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __mul__ (line 110) | def __mul__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __truediv__ (line 119) | def __truediv__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __floordiv__ (line 126) | def __floordiv__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __mod__ (line 133) | def __mod__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __pow__ (line 140) | def __pow__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __abs__ (line 147) | def __abs__(self) -> 'FixedPoint': method __float__ (line 150) | def __float__(self) -> float: method __int__ (line 153) | def __int__(self) -> int: method __trunc__ (line 156) | def __trunc__(self) -> int: method __ceil__ (line 159) | def __ceil__(self) -> int: method __floor__ (line 162) | def __floor__(self) -> int: method __round__ (line 167) | def __round__(self, ndigits: Optional[int] = 0) -> Any: method __neg__ (line 170) | def __neg__(self) -> 'FixedPoint': method __pos__ (line 173) | def __pos__(self) -> 'FixedPoint': method __eq__ (line 178) | def __eq__(self, other: Any) -> bool: method __ne__ (line 187) | def __ne__(self, other: Any) -> bool: method __le__ (line 190) | def __le__(self, other: 'FixedPoint') -> bool: method __lt__ (line 193) | def __lt__(self, other: 'FixedPoint') -> bool: method __ge__ (line 196) | def __ge__(self, other: 'FixedPoint') -> bool: method __gt__ (line 199) | def __gt__(self, other: 'FixedPoint') -> bool: method __hash__ (line 202) | def __hash__(self) -> int: method __radd__ (line 221) | def __radd__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __rsub__ (line 232) | def __rsub__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __rmul__ (line 243) | def __rmul__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __rtruediv__ (line 252) | def __rtruediv__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __rfloordiv__ (line 259) | def __rfloordiv__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __rmod__ (line 266) | def __rmod__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method __rpow__ (line 273) | def __rpow__(self, other: Union['FixedPoint', int]) -> 'FixedPoint': method round_to (line 280) | def round_to(self, new_scale: int) -> 'FixedPoint': FILE: Chapter_9/ch09_ex1.py class Angle (line 22) | class Angle(float): method from_radians (line 26) | def from_radians(value: float) -> "Angle": method __init__ (line 29) | def __init__(self, degrees: float) -> None: method radians (line 33) | def radians(self) -> float: method degrees (line 37) | def degrees(self) -> float: class Suit (line 61) | class Suit(Enum): class CardTO (line 74) | class CardTO: method __init__ (line 77) | def __init__(self, rank: int, suit: Suit) -> None: method __eq__ (line 81) | def __eq__(self, other: Any) -> bool: method __lt__ (line 84) | def __lt__(self, other: Any) -> bool: method __str__ (line 87) | def __str__(self) -> str: class CardDC (line 112) | class CardDC: method __eq__ (line 116) | def __eq__(self, other: Any) -> bool: method __lt__ (line 119) | def __lt__(self, other: Any) -> bool: method __le__ (line 122) | def __le__(self, other: Any) -> bool: method __str__ (line 125) | def __str__(self) -> str: class Deck (line 149) | class Deck(list): method __init__ (line 151) | def __init__(self, size: int = 1) -> None: class EnumDomain (line 168) | class EnumDomain: method domain (line 171) | def domain(cls: Type) -> List[str]: class SuitD (line 175) | class SuitD(str, EnumDomain, Enum): function debug (line 214) | def debug(function: F) -> F: function ackermann (line 227) | def ackermann(m: int, n: int) -> int: function debug2 (line 249) | def debug2(function: F) -> F: function ackermann2 (line 263) | def ackermann2(m: int, n: int) -> int: function simpler (line 275) | def simpler(x: int, y: int) -> int: function decorator (line 292) | def decorator(config) -> Callable[[F], F]: function debug_named (line 304) | def debug_named(log_name: str) -> Callable[[F], F]: function ackermann3 (line 322) | def ackermann3(m: int, n: int) -> int: function standard (line 346) | def standard(class_: Type) -> Type: function nonstandard (line 351) | def nonstandard(based_on: Type) -> Callable[[Type], Type]: class Unit (line 360) | class Unit: method value (line 364) | def value(class_, value: float) -> float: method convert (line 370) | def convert(class_, value: float) -> float: class INCH (line 377) | class INCH(Unit): class FOOT (line 383) | class FOOT(Unit): function audit (line 399) | def audit(method: F) -> F: class Hand (line 419) | class Hand: method __init__ (line 421) | def __init__(self, *cards: CardDC) -> None: method __iadd__ (line 425) | def __iadd__(self, card: CardDC) -> "Hand": method __repr__ (line 430) | def __repr__(self) -> str: function memento (line 471) | def memento(class_: Type) -> Type: class StatefulClass (line 484) | class StatefulClass: method __init__ (line 486) | def __init__(self, value: Any) -> None: method __repr__ (line 489) | def __repr__(self) -> str: class Memento (line 500) | class Memento: method memento (line 502) | def memento(self) -> str: class StatefulClass2 (line 506) | class StatefulClass2(Memento): method __init__ (line 508) | def __init__(self, value): method __repr__ (line 511) | def __repr__(self): FILE: Chapter_9/ch09_ex2.py class UglyClass1 (line 18) | class UglyClass1: method __init__ (line 20) | def __init__(self) -> None: method method (line 24) | def method(self, *args: Any) -> int: class UglyClass2 (line 30) | class UglyClass2: method __init__ (line 33) | def __init__(self) -> None: method method (line 36) | def method(self, *args: Any) -> int: function logged (line 45) | def logged(class_: Type) -> Type: class SomeClass (line 51) | class SomeClass: method __init__ (line 53) | def __init__(self) -> None: method method (line 56) | def method(self, *args: Any) -> int: class LoggedInstance (line 62) | class LoggedInstance: method __new__ (line 65) | def __new__(cls): class SomeClass2 (line 71) | class SomeClass2(LoggedInstance): method __init__ (line 73) | def __init__(self) -> None: method method (line 76) | def method(self, *args: Any) -> int: class LoggedClassMeta (line 84) | class LoggedClassMeta(type): method __new__ (line 86) | def __new__(cls, name, bases, namespace, **kwds): class LoggedClass (line 92) | class LoggedClass(metaclass=LoggedClassMeta): class SomeClass3 (line 97) | class SomeClass3(LoggedClass): method __init__ (line 99) | def __init__(self) -> None: method method (line 102) | def method(self, *args: Any) -> int: class LoggedWithHook (line 107) | class LoggedWithHook: method __init_subclass__ (line 108) | def __init_subclass__(cls, name=None): class SomeClass4 (line 112) | class SomeClass4(LoggedWithHook): method __init__ (line 114) | def __init__(self) -> None: method method (line 117) | def method(self, *args: Any) -> int: class SomeClass4s (line 121) | class SomeClass4s(LoggedWithHook, name='special'): method __init__ (line 123) | def __init__(self) -> None: method method (line 126) | def method(self, *args: Any) -> int: FILE: stubs/sqlite3.pyi function connect (line 7) | def connect( FILE: test_all.py function package_module_iter (line 27) | def package_module_iter(packages: Iterable[Path]) -> Iterator[Tuple[Path... function run (line 58) | def run(pkg_mod_iter: Iterable[Tuple[Path, Iterable[Path]]]) -> None: function run_doctest_suite (line 74) | def run_doctest_suite(pkg_mod_iter: Iterable[Tuple[Path, Iterable[Path]]... class PytestExit (line 92) | class PytestExit(int, Enum): function run_pytest_suite (line 100) | def run_pytest_suite(pkg_mod_iter: Iterable[Tuple[Path, Iterable[Path]]]... function run_performance (line 115) | def run_performance(pkg_mod_iter: Iterable[Tuple[Path, Iterable[Path]]])... function master_test_suite (line 131) | def master_test_suite(pkg_mod_iter: Iterable[Tuple[Path, Iterable[Path]]... function chap_key (line 146) | def chap_key(name: Path) -> int: