SYMBOL INDEX (848 symbols across 167 files) FILE: cookbook/c01/p03_nitem.py function search (line 10) | def search(lines, pattern, history=5): FILE: cookbook/c01/p04_nlargest.py function main (line 10) | def main(): FILE: cookbook/c01/p05_priority_queue.py class PriorityQueue (line 10) | class PriorityQueue: method __init__ (line 11) | def __init__(self): method push (line 15) | def push(self, item, priority): method pop (line 19) | def pop(self): FILE: cookbook/c01/p06_multidict.py function multi_dict (line 11) | def multi_dict(): FILE: cookbook/c01/p08_calculate_dict.py function calc_dict (line 9) | def calc_dict(): FILE: cookbook/c01/p09_dict_common.py function dict_commonality (line 9) | def dict_commonality(): FILE: cookbook/c01/p10_remove_duplicate.py function dedupe (line 9) | def dedupe(items): function dedupe2 (line 18) | def dedupe2(items, key=None): function remove_dup (line 28) | def remove_dup(): FILE: cookbook/c01/p11_naming_slice.py function name_slice (line 9) | def name_slice(): FILE: cookbook/c01/p12_mostfreq_items.py function most_freqency (line 9) | def most_freqency(): FILE: cookbook/c01/p13_sort_dictlist.py function sort_dictlist (line 9) | def sort_dictlist(): FILE: cookbook/c01/p14_sort_nocompare.py class User (line 9) | class User: method __init__ (line 10) | def __init__(self, user_id): method __repr__ (line 13) | def __repr__(self): function sort_notcompare (line 17) | def sort_notcompare(): FILE: cookbook/c01/p15_group.py function group_iter (line 11) | def group_iter(): FILE: cookbook/c01/p16_filter.py function cb_filter (line 10) | def cb_filter(): FILE: cookbook/c01/p17_subdict.py function sub_dict (line 9) | def sub_dict(): FILE: cookbook/c01/p18_nameseq.py function name_seq (line 10) | def name_seq(): function compute_cost (line 21) | def compute_cost(records): function compute_cost2 (line 28) | def compute_cost2(records): function dict_to_stock (line 45) | def dict_to_stock(s): function default_stock (line 48) | def default_stock(): FILE: cookbook/c01/p19_trans_reduce.py function trans_reduce (line 10) | def trans_reduce(): FILE: cookbook/c01/p20_combine_map.py function combine_map (line 11) | def combine_map(): FILE: cookbook/c02/p01_splitstr.py function split_str (line 10) | def split_str(): FILE: cookbook/c02/p02_str_start.py function start_end (line 12) | def start_end(): function read_data (line 39) | def read_data(name): FILE: cookbook/c02/p03_unix_match.py function unix_match (line 10) | def unix_match(): FILE: cookbook/c02/p04_match_search.py function match_search (line 10) | def match_search(): FILE: cookbook/c02/p05_search_replace.py function change_date (line 11) | def change_date(m): function search_replace (line 16) | def search_replace(): FILE: cookbook/c02/p06_case_insensitive.py function matchcase (line 10) | def matchcase(word): function case_insens (line 23) | def case_insens(): FILE: cookbook/c02/p07_shortest_match.py function short_match (line 11) | def short_match(): FILE: cookbook/c02/p08_multiline_match.py function multiline_match (line 10) | def multiline_match(): FILE: cookbook/c02/p09_normal_unicode.py function nor_unicode (line 10) | def nor_unicode(): FILE: cookbook/c02/p10_re_unicode.py function re_unicode (line 10) | def re_unicode(): FILE: cookbook/c02/p11_strip.py function strip_str (line 10) | def strip_str(): FILE: cookbook/c02/p12_translate.py function clean_spaces (line 11) | def clean_spaces(s): function translate_str (line 19) | def translate_str(): FILE: cookbook/c02/p13_align_str.py function align_str (line 9) | def align_str(): FILE: cookbook/c02/p14_join_str.py function combine (line 9) | def combine(source, maxsize): function sample (line 22) | def sample(): function join_str (line 29) | def join_str(): FILE: cookbook/c02/p15_var_string.py class Info (line 9) | class Info: method __init__ (line 10) | def __init__(self, name, n): class SafeSub (line 15) | class SafeSub(dict): method __missing__ (line 17) | def __missing__(self, key): function sub (line 21) | def sub(text): function var_str (line 24) | def var_str(): FILE: cookbook/c02/p16_textwrap.py function reformat_width (line 11) | def reformat_width(): FILE: cookbook/c02/p17_html_xml.py function html_xml (line 10) | def html_xml(): FILE: cookbook/c02/p18_tokenize.py function tokenize_str (line 11) | def tokenize_str(): function generate_tokens (line 70) | def generate_tokens(pat, text): FILE: cookbook/c02/p19_descent_parser.py function generate_tokens (line 26) | def generate_tokens(text): class ExpressionEvaluator (line 35) | class ExpressionEvaluator: method parse (line 44) | def parse(self, text): method _advance (line 51) | def _advance(self): method _accept (line 55) | def _accept(self, toktype): method _expect (line 63) | def _expect(self, toktype): method expr (line 69) | def expr(self): method term (line 81) | def term(self): method factor (line 93) | def factor(self): function descent_parser (line 105) | def descent_parser(): FILE: cookbook/c02/p20_byte_str.py function byte_str (line 11) | def byte_str(): FILE: cookbook/c03/p01_round.py function round_num (line 9) | def round_num(): FILE: cookbook/c03/p02_accurate_decimal.py function acc_deciamal (line 12) | def acc_deciamal(): FILE: cookbook/c03/p03_format_number.py function format_number (line 9) | def format_number(): FILE: cookbook/c03/p04_bin_octal.py function bin_octal (line 9) | def bin_octal(): FILE: cookbook/c03/p05_int_bytes.py function int_bytes (line 9) | def int_bytes(): FILE: cookbook/c03/p06_complex.py function complex_math (line 10) | def complex_math(): FILE: cookbook/c03/p07_inf_nan.py function inf_nan (line 9) | def inf_nan(): FILE: cookbook/c03/p08_fraction.py function frac (line 10) | def frac(): FILE: cookbook/c03/p09_array_numpy.py function array_numpy (line 10) | def array_numpy(): function f (line 50) | def f(x): FILE: cookbook/c03/p10_matrix_linear.py function matrix_linear (line 11) | def matrix_linear(): FILE: cookbook/c03/p11_random_num.py function random_num (line 10) | def random_num(): FILE: cookbook/c03/p12_datatime.py function date_time (line 12) | def date_time(): FILE: cookbook/c03/p13_last_friday.py function get_previous_byday (line 15) | def get_previous_byday(dayname, start_date=None): function last_friday (line 27) | def last_friday(): FILE: cookbook/c03/p14_month_range.py function get_month_range (line 11) | def get_month_range(start_date=None): function date_range (line 19) | def date_range(start, stop, step): function month_range (line 25) | def month_range(): FILE: cookbook/c03/p15_str_datetime.py function str_datetime (line 10) | def str_datetime(): function parse_ymd (line 22) | def parse_ymd(s): FILE: cookbook/c03/p16_timezone.py function tz_local (line 12) | def tz_local(): FILE: cookbook/c04/p01_manual_iterator.py function manual_iter (line 9) | def manual_iter(): function manual_iter2 (line 18) | def manual_iter2(): FILE: cookbook/c04/p02_delegate_iter.py class Node (line 9) | class Node: method __init__ (line 10) | def __init__(self, value): method __repr__ (line 14) | def __repr__(self): method add_child (line 17) | def add_child(self, node): method __iter__ (line 20) | def __iter__(self): FILE: cookbook/c04/p03_generator_pattern.py function frange (line 9) | def frange(start, stop, increment): function countdown (line 16) | def countdown(n): function gen_pattern (line 24) | def gen_pattern(): FILE: cookbook/c04/p04_iterator_protocol.py class Node (line 9) | class Node: method __init__ (line 10) | def __init__(self, value): method __repr__ (line 14) | def __repr__(self): method add_child (line 17) | def add_child(self, node): method __iter__ (line 20) | def __iter__(self): method depth_first (line 23) | def depth_first(self): class Node2 (line 29) | class Node2: method __init__ (line 30) | def __init__(self, value): method __repr__ (line 34) | def __repr__(self): method add_child (line 37) | def add_child(self, node): method __iter__ (line 40) | def __iter__(self): method depth_first (line 43) | def depth_first(self): class DepthFirstIterator (line 47) | class DepthFirstIterator(object): method __init__ (line 52) | def __init__(self, start_node): method __iter__ (line 57) | def __iter__(self): method __next__ (line 60) | def __next__(self): FILE: cookbook/c04/p05_reverse_iterate.py function reverse_iterate (line 9) | def reverse_iterate(): class Countdown (line 27) | class Countdown: method __init__ (line 28) | def __init__(self, start): method __iter__ (line 32) | def __iter__(self): method __reversed__ (line 39) | def __reversed__(self): FILE: cookbook/c04/p06_generator_extrastate.py class linehistory (line 10) | class linehistory: method __init__ (line 11) | def __init__(self, lines, histlen=3): method __iter__ (line 15) | def __iter__(self): method clear (line 20) | def clear(self): function gen_extrastate (line 24) | def gen_extrastate(): FILE: cookbook/c04/p07_iterator_slice.py function count (line 10) | def count(n): function iter_slice (line 16) | def iter_slice(): FILE: cookbook/c04/p08_skip_iterable.py function skip_iter (line 11) | def skip_iter(): FILE: cookbook/c04/p09_iter_permutation.py function iter_permutation (line 12) | def iter_permutation(): FILE: cookbook/c04/p10_iterate_index.py function iterate_index (line 10) | def iterate_index(): function parse_data (line 25) | def parse_data(filename): function word_lines (line 36) | def word_lines(): FILE: cookbook/c04/p11_iterate_simultaneous.py function iterate_simul (line 10) | def iterate_simul(): FILE: cookbook/c04/p12_iterate_separate.py function iter_separate (line 10) | def iter_separate(): FILE: cookbook/c04/p13_process_pipline.py function gen_find (line 15) | def gen_find(filepat, top): function gen_opener (line 24) | def gen_opener(filenames): function gen_concatenate (line 40) | def gen_concatenate(iterators): function gen_grep (line 48) | def gen_grep(pattern, lines): function process_pipline (line 58) | def process_pipline(): FILE: cookbook/c04/p14_flatten_sequence.py function flatten (line 10) | def flatten(items, ignore_types=(str, bytes)): function flatten_seq (line 18) | def flatten_seq(): FILE: cookbook/c04/p15_merge_sorted.py function merge_sorted (line 10) | def merge_sorted(): FILE: cookbook/c04/p16_iterate_while.py function process_data (line 10) | def process_data(): function reader (line 14) | def reader(s, size): function reader2 (line 22) | def reader2(s, size): function iterate_while (line 27) | def iterate_while(): FILE: cookbook/c05/p01_rw_text.py function rw_text (line 8) | def rw_text(): FILE: cookbook/c05/p02_print_tofile.py function print_tofile (line 9) | def print_tofile(): FILE: cookbook/c05/p03_print_sepend.py function print_sepend (line 8) | def print_sepend(): FILE: cookbook/c05/p04_rw_binary.py function rw_binary (line 9) | def rw_binary(): FILE: cookbook/c05/p05_write_notexist.py function write_noexist (line 9) | def write_noexist(): FILE: cookbook/c05/p06_string_io.py function string_io (line 10) | def string_io(): FILE: cookbook/c05/p07_gzip_bz2.py function gzip_bz2 (line 11) | def gzip_bz2(): FILE: cookbook/c05/p08_iterate_fixedsize.py function iterate_fixed (line 10) | def iterate_fixed(): FILE: cookbook/c05/p09_read_tobuffer.py function read_into_buffer (line 10) | def read_into_buffer(filename): function read_tobuffer (line 17) | def read_tobuffer(): FILE: cookbook/c05/p10_memery_mapping.py function memory_map (line 11) | def memory_map(filename, access=mmap.ACCESS_WRITE): function mem_mapping (line 17) | def mem_mapping(): FILE: cookbook/c05/p11_pathnames.py function path_names (line 10) | def path_names(): FILE: cookbook/c05/p12_file_existence.py function file_existence (line 11) | def file_existence(): FILE: cookbook/c05/p13_dir_listfile.py function dir_listfile (line 13) | def dir_listfile(): FILE: cookbook/c05/p14_bypass_encode.py function bypass_encoding (line 10) | def bypass_encoding(): FILE: cookbook/c05/p15_print_badfile.py function bad_filename (line 11) | def bad_filename(filename): function bad_filename2 (line 15) | def bad_filename2(filename): function print_badfile (line 21) | def print_badfile(filename): FILE: cookbook/c05/p16_change_opencode.py function change_open_encode (line 12) | def change_open_encode(): FILE: cookbook/c05/p17_bytes_tofile.py function bytes_tofile (line 10) | def bytes_tofile(): FILE: cookbook/c05/p18_file_descriptor.py function file_descriptor (line 12) | def file_descriptor(): function echo_client (line 26) | def echo_client(client_sock, addr): function echo_server (line 44) | def echo_server(address): FILE: cookbook/c05/p19_temp_file.py function temp_file (line 13) | def temp_file(): FILE: cookbook/c05/p20_serial_ports.py function serial_posts (line 10) | def serial_posts(): FILE: cookbook/c05/p21_serialize_object.py function serailize_object (line 10) | def serailize_object(): FILE: cookbook/c06/p01_rw_csv.py function rw_csv (line 11) | def rw_csv(): FILE: cookbook/c06/p02_rw_json.py class JSONObject (line 11) | class JSONObject: method __init__ (line 12) | def __init__(self, d): class Point (line 16) | class Point: method __init__ (line 17) | def __init__(self, x, y): function serialize_instance (line 22) | def serialize_instance(obj): function unserialize_object (line 28) | def unserialize_object(d): function rw_json (line 45) | def rw_json(): FILE: cookbook/c06/p03_simple_xml.py function simple_xml (line 11) | def simple_xml(): FILE: cookbook/c06/p04_huge_xml.py function parse_and_remove (line 12) | def parse_and_remove(filename, path): function huge_xml (line 35) | def huge_xml(): FILE: cookbook/c06/p05_dict_toxml.py function dict_to_xml (line 11) | def dict_to_xml(tag, d): FILE: cookbook/c06/p06_rw_xml.py function rw_xml (line 10) | def rw_xml(): FILE: cookbook/c06/p07_namespace_xml.py class XMLNamespaces (line 9) | class XMLNamespaces: method __init__ (line 10) | def __init__(self, **kwargs): method register (line 15) | def register(self, name, uri): method __call__ (line 18) | def __call__(self, path): FILE: cookbook/c06/p08_database.py function db_operation (line 11) | def db_operation(): FILE: cookbook/c06/p09_codec_hex.py function codec_hex (line 11) | def codec_hex(): FILE: cookbook/c06/p10_codec_base64.py function codec_base64 (line 10) | def codec_base64(): FILE: cookbook/c06/p11_rw_barray.py function write_records (line 11) | def write_records(records, format, f): function read_records (line 20) | def read_records(format, f): function unpack_records (line 26) | def unpack_records(format, data): FILE: cookbook/c06/p12_var_binary.py function write_polys (line 16) | def write_polys(filename, polys): function read_polys (line 36) | def read_polys(filename): FILE: cookbook/c07/p02_keyarg_only.py function recv (line 9) | def recv(maxsize, *, block): function minimum (line 17) | def minimum(*values, clip=None): FILE: cookbook/c07/p03_func_annotate.py function add (line 8) | def add(x:int, y:int) -> int: FILE: cookbook/c07/p05_default_argument.py function spam (line 8) | def spam(a, b=42): function spam (line 16) | def spam(a, b=_no_value): FILE: cookbook/c07/p08_partial.py function spam (line 13) | def spam(a, b, c, d): function output_result (line 17) | def output_result(result, log=None): function add (line 23) | def add(x, y): class EchoHandler (line 27) | class EchoHandler(StreamRequestHandler): method __init__ (line 30) | def __init__(self, *args, ack, **kwargs): method handle (line 34) | def handle(self): FILE: cookbook/c07/p09_class_to_func.py class UrlTemplate (line 11) | class UrlTemplate: method __init__ (line 12) | def __init__(self, template): method open (line 15) | def open(self, **kwargs): function urltemplate (line 25) | def urltemplate(template): FILE: cookbook/c07/p10_callback.py function apply_async (line 9) | def apply_async(func, args, *, callback): function add (line 17) | def add(x, y): class ResultHandler (line 22) | class ResultHandler: method __init__ (line 24) | def __init__(self): method handler (line 27) | def handler(self, result): function make_handler (line 37) | def make_handler(): function make_handler (line 51) | def make_handler(): FILE: cookbook/c07/p11_inline_callback.py function apply_async (line 11) | def apply_async(func, args, *, callback): class Async (line 19) | class Async: method __init__ (line 20) | def __init__(self, func, args): function inlined_async (line 25) | def inlined_async(func): function add (line 48) | def add(x, y): function test (line 53) | def test(): FILE: cookbook/c07/p12_closure_access.py function sample (line 9) | def sample(): class ClosureInstance (line 34) | class ClosureInstance: method __init__ (line 35) | def __init__(self, locals=None): method __len__ (line 43) | def __len__(self): function Stack (line 47) | def Stack(): FILE: cookbook/c08/p01_str_represent.py class Pair (line 9) | class Pair: method __init__ (line 10) | def __init__(self, x, y): method __repr__ (line 14) | def __repr__(self): method __str__ (line 17) | def __str__(self): FILE: cookbook/c08/p02_custom_format.py class Date (line 14) | class Date: method __init__ (line 15) | def __init__(self, year, month, day): method __format__ (line 20) | def __format__(self, code): FILE: cookbook/c08/p03_context_protocol.py class LazyConnection (line 11) | class LazyConnection: method __init__ (line 12) | def __init__(self, address, family=AF_INET, type=SOCK_STREAM): method __enter__ (line 18) | def __enter__(self): method __exit__ (line 25) | def __exit__(self, exc_ty, exc_val, tb): class LazyConnection2 (line 44) | class LazyConnection2: method __init__ (line 45) | def __init__(self, address, family=AF_INET, type=SOCK_STREAM): method __enter__ (line 51) | def __enter__(self): method __exit__ (line 57) | def __exit__(self, exc_ty, exc_val, tb): FILE: cookbook/c08/p04_slots.py class Date (line 9) | class Date: method __init__ (line 12) | def __init__(self, year, month, day): FILE: cookbook/c08/p05_encapsulate_name.py class A (line 9) | class A: method __init__ (line 10) | def __init__(self): method public_method (line 14) | def public_method(self): method _internal_method (line 20) | def _internal_method(self): class B (line 24) | class B: method __init__ (line 25) | def __init__(self): method __private_method (line 28) | def __private_method(self): method public_method (line 31) | def public_method(self): class C (line 36) | class C(B): method __init__ (line 37) | def __init__(self): method __private_method (line 42) | def __private_method(self): FILE: cookbook/c08/p06_managed_attribute.py class Person (line 10) | class Person: method __init__ (line 11) | def __init__(self, first_name): method first_name (line 16) | def first_name(self): method first_name (line 21) | def first_name(self, value): method first_name (line 28) | def first_name(self): class Person1 (line 38) | class Person1: method __init__ (line 39) | def __init__(self, first_name): method get_first_name (line 43) | def get_first_name(self): method set_first_name (line 47) | def set_first_name(self, value): method del_first_name (line 53) | def del_first_name(self): class Circle (line 65) | class Circle: method __init__ (line 68) | def __init__(self, radius): method diameter (line 72) | def diameter(self): method perimeter (line 76) | def perimeter(self): method area (line 80) | def area(self): FILE: cookbook/c08/p07_super_method.py class A (line 9) | class A: method spam (line 10) | def spam(self): class B (line 14) | class B(A): method spam (line 15) | def spam(self): class A1 (line 20) | class A1: method __init__ (line 21) | def __init__(self): class B1 (line 25) | class B1(A1): method __init__ (line 26) | def __init__(self): class Proxy (line 31) | class Proxy(): method __init__ (line 32) | def __init__(self, obj): method __getattr__ (line 36) | def __getattr__(self, name): method __setattr__ (line 40) | def __setattr__(self, name, value): class Base (line 47) | class Base: method __init__ (line 48) | def __init__(self): class AA (line 52) | class AA(Base): method __init__ (line 53) | def __init__(self): class BB (line 58) | class BB(Base): method __init__ (line 59) | def __init__(self): class CC (line 64) | class CC(AA, BB): method __init__ (line 65) | def __init__(self): class A3 (line 74) | class A3: method spam (line 75) | def spam(self): class B3 (line 80) | class B3: method spam (line 81) | def spam(self): class C3 (line 85) | class C3(A3, B3): FILE: cookbook/c08/p08_extend_property.py class Person (line 9) | class Person: method __init__ (line 10) | def __init__(self, name): method name (line 15) | def name(self): method name (line 20) | def name(self, value): method name (line 27) | def name(self): method __init__ (line 73) | def __init__(self, name): class SubPerson (line 31) | class SubPerson(Person): method name (line 33) | def name(self): method name (line 38) | def name(self, value): method name (line 43) | def name(self): method name (line 80) | def name(self): method name (line 85) | def name(self, value): method name (line 90) | def name(self): class String (line 54) | class String: method __init__ (line 55) | def __init__(self, name): method __get__ (line 58) | def __get__(self, instance, cls): method __set__ (line 63) | def __set__(self, instance, value): class Person (line 70) | class Person: method __init__ (line 10) | def __init__(self, name): method name (line 15) | def name(self): method name (line 20) | def name(self, value): method name (line 27) | def name(self): method __init__ (line 73) | def __init__(self, name): class SubPerson (line 78) | class SubPerson(Person): method name (line 33) | def name(self): method name (line 38) | def name(self, value): method name (line 43) | def name(self): method name (line 80) | def name(self): method name (line 85) | def name(self, value): method name (line 90) | def name(self): FILE: cookbook/c08/p09_descriptor.py class Integer (line 9) | class Integer: method __init__ (line 10) | def __init__(self, name): method __get__ (line 13) | def __get__(self, instance, cls): method __set__ (line 19) | def __set__(self, instance, value): method __delete__ (line 24) | def __delete__(self, instance): class Point (line 28) | class Point: method __init__ (line 32) | def __init__(self, x, y): class Typed (line 43) | class Typed: method __init__ (line 44) | def __init__(self, name, expected_type): method __get__ (line 48) | def __get__(self, instance, cls): method __set__ (line 54) | def __set__(self, instance, value): method __delete__ (line 59) | def __delete__(self, instance): function typeassert (line 64) | def typeassert(**kwargs): class Stock (line 76) | class Stock: method __init__ (line 77) | def __init__(self, name, shares, price): FILE: cookbook/c08/p10_lazy_property.py class lazyproperty (line 10) | class lazyproperty: method __init__ (line 11) | def __init__(self, func): method __get__ (line 14) | def __get__(self, instance, cls): class Circle (line 23) | class Circle: method __init__ (line 24) | def __init__(self, radius): method area (line 28) | def area(self): method perimeter (line 33) | def perimeter(self): function lazyproperty2 (line 46) | def lazyproperty2(func): FILE: cookbook/c08/p11_simplify_init.py class Structure1 (line 10) | class Structure1: method __init__ (line 14) | def __init__(self, *args): class Stock (line 23) | class Stock(Structure1): class Point (line 26) | class Point(Structure1): class Circle (line 29) | class Circle(Structure1): method area (line 32) | def area(self): class Structure2 (line 40) | class Structure2: method __init__ (line 43) | def __init__(self, *args, **kwargs): class Stock (line 61) | class Stock(Structure2): class Structure3 (line 70) | class Structure3: method __init__ (line 74) | def __init__(self, *args, **kwargs): class Stock (line 92) | class Stock(Structure3): class Structure4 (line 99) | class Structure4: method __init__ (line 102) | def __init__(self, *args): FILE: cookbook/c08/p12_abstract_interface.py class IStream (line 10) | class IStream(metaclass=ABCMeta): method read (line 12) | def read(self, maxbytes=-1): method write (line 16) | def write(self, data): class SocketStream (line 20) | class SocketStream(IStream): method read (line 21) | def read(self, maxbytes=-1): method write (line 24) | def write(self, data): class A (line 28) | class A(metaclass=ABCMeta): method name (line 31) | def name(self): method name (line 36) | def name(self, value): method method1 (line 41) | def method1(cls): method method2 (line 46) | def method2(): FILE: cookbook/c08/p13_type_system.py class Descriptor (line 10) | class Descriptor: method __init__ (line 11) | def __init__(self, name=None, **opts): method __set__ (line 16) | def __set__(self, instance, value): method __init__ (line 131) | def __init__(self, name=None, **opts): method __set__ (line 136) | def __set__(self, instance, value): class Typed (line 21) | class Typed(Descriptor): method __set__ (line 24) | def __set__(self, instance, value): class Unsigned (line 31) | class Unsigned(Descriptor): method __set__ (line 32) | def __set__(self, instance, value): class MaxSized (line 38) | class MaxSized(Descriptor): method __init__ (line 39) | def __init__(self, name=None, **opts): method __set__ (line 44) | def __set__(self, instance, value): class Integer (line 51) | class Integer(Typed): class UnsignedInteger (line 54) | class UnsignedInteger(Integer, Unsigned): class Float (line 57) | class Float(Typed): class UnsignedFloat (line 60) | class UnsignedFloat(Float, Unsigned): class String (line 63) | class String(Typed): class SizedString (line 66) | class SizedString(String, MaxSized): class Stock (line 69) | class Stock: method __init__ (line 75) | def __init__(self, name, shares, price): method __init__ (line 100) | def __init__(self, name, shares, price): function check_attributes (line 83) | def check_attributes(**kwargs): class Stock (line 99) | class Stock: method __init__ (line 75) | def __init__(self, name, shares, price): method __init__ (line 100) | def __init__(self, name, shares, price): class checkedmeta (line 108) | class checkedmeta(type): method __new__ (line 109) | def __new__(cls, clsname, bases, methods): class Stock2 (line 118) | class Stock2(metaclass=checkedmeta): method __init__ (line 123) | def __init__(self, name, shares, price): class Descriptor (line 130) | class Descriptor: method __init__ (line 11) | def __init__(self, name=None, **opts): method __set__ (line 16) | def __set__(self, instance, value): method __init__ (line 131) | def __init__(self, name=None, **opts): method __set__ (line 136) | def __set__(self, instance, value): function Typed (line 141) | def Typed(expected_type, cls=None): method __set__ (line 24) | def __set__(self, instance, value): function Unsigned (line 156) | def Unsigned(cls): method __set__ (line 32) | def __set__(self, instance, value): function MaxSized (line 169) | def MaxSized(cls): method __init__ (line 39) | def __init__(self, name=None, **opts): method __set__ (line 44) | def __set__(self, instance, value): class Integer (line 192) | class Integer(Descriptor): class UnsignedInteger (line 197) | class UnsignedInteger(Integer): class Float (line 202) | class Float(Descriptor): class UnsignedFloat (line 207) | class UnsignedFloat(Float): class String (line 212) | class String(Descriptor): class SizedString (line 217) | class SizedString(String): FILE: cookbook/c08/p14_custom_container.py class SortedItems (line 12) | class SortedItems(collections.Sequence): method __init__ (line 13) | def __init__(self, initial=None): method __getitem__ (line 17) | def __getitem__(self, index): method __len__ (line 20) | def __len__(self): method add (line 24) | def add(self, item): class Items (line 35) | class Items(collections.MutableSequence): method __init__ (line 36) | def __init__(self, initial=None): method __getitem__ (line 40) | def __getitem__(self, index): method __setitem__ (line 44) | def __setitem__(self, index, value): method __delitem__ (line 48) | def __delitem__(self, index): method insert (line 52) | def insert(self, index, value): method __len__ (line 56) | def __len__(self): FILE: cookbook/c08/p15_delegate_attribute.py class A (line 9) | class A: method spam (line 10) | def spam(self, x): method foo (line 13) | def foo(self): method spam (line 133) | def spam(self, x): method foo (line 136) | def foo(self): method spam (line 150) | def spam(self, x): method foo (line 153) | def foo(self): class B1 (line 17) | class B1: method __init__ (line 20) | def __init__(self): method spam (line 23) | def spam(self, x): method foo (line 27) | def foo(self): method bar (line 31) | def bar(self): class B2 (line 35) | class B2: method __init__ (line 38) | def __init__(self): method bar (line 41) | def bar(self): method __getattr__ (line 45) | def __getattr__(self, name): class Proxy (line 59) | class Proxy: method __init__ (line 60) | def __init__(self, obj): method __getattr__ (line 64) | def __getattr__(self, name): method __setattr__ (line 69) | def __setattr__(self, name, value): method __delattr__ (line 77) | def __delattr__(self, name): class Spam (line 85) | class Spam: method __init__ (line 86) | def __init__(self, x): method bar (line 89) | def bar(self, y): class ListLike (line 102) | class ListLike: method __init__ (line 105) | def __init__(self): method __getattr__ (line 108) | def __getattr__(self, name): method __len__ (line 112) | def __len__(self): method __getitem__ (line 115) | def __getitem__(self, index): method __setitem__ (line 118) | def __setitem__(self, index, value): method __delitem__ (line 121) | def __delitem__(self, index): class A (line 132) | class A: method spam (line 10) | def spam(self, x): method foo (line 13) | def foo(self): method spam (line 133) | def spam(self, x): method foo (line 136) | def foo(self): method spam (line 150) | def spam(self, x): method foo (line 153) | def foo(self): class B (line 140) | class B(A): method spam (line 141) | def spam(self, x): method bar (line 145) | def bar(self): method __init__ (line 158) | def __init__(self): method spam (line 161) | def spam(self, x): method bar (line 165) | def bar(self): method __getattr__ (line 168) | def __getattr__(self, name): class A (line 149) | class A: method spam (line 10) | def spam(self, x): method foo (line 13) | def foo(self): method spam (line 133) | def spam(self, x): method foo (line 136) | def foo(self): method spam (line 150) | def spam(self, x): method foo (line 153) | def foo(self): class B (line 157) | class B: method spam (line 141) | def spam(self, x): method bar (line 145) | def bar(self): method __init__ (line 158) | def __init__(self): method spam (line 161) | def spam(self, x): method bar (line 165) | def bar(self): method __getattr__ (line 168) | def __getattr__(self, name): FILE: cookbook/c08/p16_more_constructor.py class Date (line 11) | class Date: method __init__ (line 14) | def __init__(self, year, month, day): method today (line 21) | def today(cls): FILE: cookbook/c08/p17_without_init.py class Date (line 9) | class Date: method __init__ (line 10) | def __init__(self, year, month, day): method __init__ (line 26) | def __init__(self, year, month, day): method today (line 32) | def today(cls): class Date (line 25) | class Date: method __init__ (line 10) | def __init__(self, year, month, day): method __init__ (line 26) | def __init__(self, year, month, day): method today (line 32) | def today(cls): FILE: cookbook/c08/p18_mixin_classes.py class LoggedMappingMixin (line 10) | class LoggedMappingMixin: method __getitem__ (line 16) | def __getitem__(self, key): method __setitem__ (line 20) | def __setitem__(self, key, value): method __delitem__ (line 24) | def __delitem__(self, key): class SetOnceMappingMixin (line 29) | class SetOnceMappingMixin: method __setitem__ (line 35) | def __setitem__(self, key, value): class StringKeysMappingMixin (line 41) | class StringKeysMappingMixin: method __setitem__ (line 47) | def __setitem__(self, key, value): class LoggedDict (line 53) | class LoggedDict(LoggedMappingMixin, dict): class SetOnceDefaultDict (line 65) | class SetOnceDefaultDict(SetOnceMappingMixin, defaultdict): function LoggedMapping (line 75) | def LoggedMapping(cls): class LoggedDict (line 100) | class LoggedDict(dict): FILE: cookbook/c08/p19_stateful_object.py class Connection (line 9) | class Connection: method __init__ (line 12) | def __init__(self): method read (line 15) | def read(self): method write (line 20) | def write(self, data): method open (line 25) | def open(self): method close (line 30) | def close(self): class Connection1 (line 36) | class Connection1: method __init__ (line 39) | def __init__(self): method new_state (line 42) | def new_state(self, newstate): method read (line 46) | def read(self): method write (line 49) | def write(self, data): method open (line 52) | def open(self): method close (line 55) | def close(self): class ConnectionState (line 60) | class ConnectionState: method read (line 62) | def read(conn): method write (line 66) | def write(conn, data): method open (line 70) | def open(conn): method close (line 74) | def close(conn): class ClosedConnectionState (line 79) | class ClosedConnectionState(ConnectionState): method read (line 81) | def read(conn): method write (line 85) | def write(conn, data): method open (line 89) | def open(conn): method close (line 93) | def close(conn): class OpenConnectionState (line 97) | class OpenConnectionState(ConnectionState): method read (line 99) | def read(conn): method write (line 103) | def write(conn, data): method open (line 107) | def open(conn): method close (line 111) | def close(conn): class State (line 120) | class State: method __init__ (line 121) | def __init__(self): method new_state (line 124) | def new_state(self, state): method action (line 127) | def action(self, x): class State_A (line 131) | class State_A(State): method action (line 132) | def action(self, x): class State_B (line 138) | class State_B(State): method action (line 139) | def action(self, x): class State_C (line 145) | class State_C(State): method action (line 146) | def action(self, x): FILE: cookbook/c08/p20_invoke_bystr.py class Point (line 11) | class Point: method __init__ (line 12) | def __init__(self, x, y): method __repr__ (line 16) | def __repr__(self): method distance (line 20) | def distance(self, x, y): FILE: cookbook/c08/p21_vistor_pattern.py class Node (line 9) | class Node: class UnaryOperator (line 13) | class UnaryOperator(Node): method __init__ (line 14) | def __init__(self, operand): class BinaryOperator (line 18) | class BinaryOperator(Node): method __init__ (line 19) | def __init__(self, left, right): class Add (line 24) | class Add(BinaryOperator): class Sub (line 28) | class Sub(BinaryOperator): class Mul (line 32) | class Mul(BinaryOperator): class Div (line 36) | class Div(BinaryOperator): class Negate (line 40) | class Negate(UnaryOperator): class Number (line 44) | class Number(Node): method __init__ (line 45) | def __init__(self, value): class NodeVisitor (line 55) | class NodeVisitor: method visit (line 56) | def visit(self, node): method generic_visit (line 63) | def generic_visit(self, node): class Evaluator (line 67) | class Evaluator(NodeVisitor): method visit_Number (line 68) | def visit_Number(self, node): method visit_Add (line 71) | def visit_Add(self, node): method visit_Sub (line 74) | def visit_Sub(self, node): method visit_Mul (line 77) | def visit_Mul(self, node): method visit_Div (line 80) | def visit_Div(self, node): method visit_Negate (line 83) | def visit_Negate(self, node): class StackCode (line 91) | class StackCode(NodeVisitor): method generate_code (line 92) | def generate_code(self, node): method visit_Number (line 97) | def visit_Number(self, node): method binop (line 100) | def binop(self, node, instruction): method visit_Add (line 105) | def visit_Add(self, node): method visit_Sub (line 108) | def visit_Sub(self, node): method visit_Mul (line 111) | def visit_Mul(self, node): method visit_Div (line 114) | def visit_Div(self, node): method unaryop (line 117) | def unaryop(self, node, instruction): method visit_Negate (line 121) | def visit_Negate(self, node): class HTTPHandler (line 125) | class HTTPHandler: method handle (line 126) | def handle(self, request): method do_GET (line 129) | def do_GET(self, request): method do_POST (line 131) | def do_POST(self, request): method do_HEAD (line 133) | def do_HEAD(self, request): FILE: cookbook/c08/p22_vistor_norecursiion.py class Node (line 11) | class Node: class NodeVisitor (line 15) | class NodeVisitor: method visit (line 16) | def visit(self, node): method _visit (line 34) | def _visit(self, node): method generic_visit (line 41) | def generic_visit(self, node): class UnaryOperator (line 45) | class UnaryOperator(Node): method __init__ (line 46) | def __init__(self, operand): class BinaryOperator (line 50) | class BinaryOperator(Node): method __init__ (line 51) | def __init__(self, left, right): class Add (line 56) | class Add(BinaryOperator): class Sub (line 60) | class Sub(BinaryOperator): class Mul (line 64) | class Mul(BinaryOperator): class Div (line 68) | class Div(BinaryOperator): class Negate (line 72) | class Negate(UnaryOperator): class Number (line 76) | class Number(Node): method __init__ (line 77) | def __init__(self, value): class Evaluator (line 82) | class Evaluator(NodeVisitor): method visit_Number (line 83) | def visit_Number(self, node): method visit_Add (line 86) | def visit_Add(self, node): method visit_Sub (line 89) | def visit_Sub(self, node): method visit_Mul (line 92) | def visit_Mul(self, node): method visit_Div (line 95) | def visit_Div(self, node): method visit_Negate (line 98) | def visit_Negate(self, node): FILE: cookbook/c08/p23_weakref.py class Node (line 11) | class Node: method __init__ (line 12) | def __init__(self, value): method __repr__ (line 17) | def __repr__(self): method parent (line 22) | def parent(self): method parent (line 26) | def parent(self, node): method add_child (line 29) | def add_child(self, child): class Data (line 35) | class Data: method __del__ (line 36) | def __del__(self): class Node1 (line 41) | class Node1: method __init__ (line 42) | def __init__(self): method add_child (line 47) | def add_child(self, child): FILE: cookbook/c08/p24_class_compare.py class Room (line 11) | class Room: method __init__ (line 12) | def __init__(self, name, length, width): class House (line 20) | class House: method __init__ (line 21) | def __init__(self, name, style): method living_space_footage (line 27) | def living_space_footage(self): method add_room (line 30) | def add_room(self, room): method __str__ (line 33) | def __str__(self): method __eq__ (line 38) | def __eq__(self, other): method __lt__ (line 41) | def __lt__(self, other): FILE: cookbook/c08/p25_cached_objects.py class Spam (line 17) | class Spam: method __init__ (line 18) | def __init__(self, name): function get_spam (line 27) | def get_spam(name): class Spam1 (line 37) | class Spam1: method __new__ (line 40) | def __new__(cls, name): method __init__ (line 49) | def __init__(self, name): class CachedSpamManager (line 59) | class CachedSpamManager: method __init__ (line 60) | def __init__(self): method get_spam (line 63) | def get_spam(self, name): method clear (line 71) | def clear(self): class Spam2 (line 75) | class Spam2: method __init__ (line 78) | def __init__(self, name): function get_spam (line 81) | def get_spam(name): class CachedSpamManager2 (line 86) | class CachedSpamManager2: method __init__ (line 87) | def __init__(self): method get_spam (line 90) | def get_spam(self, name): method clear (line 98) | def clear(self): class Spam3 (line 102) | class Spam3: method __init__ (line 103) | def __init__(self, *args, **kwargs): method _new (line 108) | def _new(cls, name): FILE: cookbook/c09/p01_wrap_function.py function timethis (line 12) | def timethis(func): function countdown (line 26) | def countdown(n): FILE: cookbook/c09/p02_preserve_metadata.py function timethis (line 12) | def timethis(func): function countdown (line 29) | def countdown(n: int): FILE: cookbook/c09/p03_unwrap_decorator.py function decorator1 (line 11) | def decorator1(func): function decorator2 (line 19) | def decorator2(func): function add (line 29) | def add(x, y): FILE: cookbook/c09/p04_decorator_argument.py function logged (line 12) | def logged(level, name=None, message=None): function add (line 37) | def add(x, y): function spam (line 42) | def spam(): FILE: cookbook/c09/p05_adjust_attribute.py function attach_wrapper (line 14) | def attach_wrapper(obj, func=None): function logged (line 21) | def logged(level, name=None, message=None): function add (line 57) | def add(x, y): function spam (line 62) | def spam(): function timethis (line 81) | def timethis(func): function countdown (line 98) | def countdown(n): function countdown1 (line 110) | def countdown1(n): FILE: cookbook/c09/p06_optarg_decorator.py function logged (line 11) | def logged(func=None, *, level=logging.DEBUG, name=None, message=None): function add (line 29) | def add(x, y): function spam (line 34) | def spam(): function aa (line 40) | def aa(kk=None, *, a=1,b=2,c=3): FILE: cookbook/c09/p07_typecheck.py function typeassert (line 12) | def typeassert(*ty_args, **ty_kwargs): function add (line 39) | def add(x, y): function bar (line 48) | def bar(x, items=None): FILE: cookbook/c09/p08_inclass_decorator.py class A (line 10) | class A: method decorator1 (line 12) | def decorator1(self, func): method decorator2 (line 21) | def decorator2(cls, func): class Person (line 28) | class Person: method first_name (line 34) | def first_name(self): method first_name (line 38) | def first_name(self, value): FILE: cookbook/c09/p09_class_decorator.py class Profiled (line 11) | class Profiled: method __init__ (line 12) | def __init__(self, func): method __call__ (line 16) | def __call__(self, *args, **kwargs): method __get__ (line 20) | def __get__(self, instance, cls): function add (line 27) | def add(x, y): class Spam (line 30) | class Spam: method bar (line 32) | def bar(self, x): function profiled (line 41) | def profiled(func): function add (line 53) | def add(x, y): FILE: cookbook/c09/p10_static_decorator.py function timethis (line 12) | def timethis(func): class Spam (line 23) | class Spam: method instance_method (line 25) | def instance_method(self, n): method class_method (line 32) | def class_method(cls, n): method static_method (line 39) | def static_method(n): class A (line 45) | class A(metaclass=ABCMeta): method method (line 48) | def method(cls): FILE: cookbook/c09/p11_add_argument.py function optional_debug (line 12) | def optional_debug(func): function spam (line 23) | def spam(a, b, c): function a (line 31) | def a(x, debug=False): function b (line 36) | def b(x, y, z, debug=False): function c (line 41) | def c(x, y, debug=False): function optional_debug (line 46) | def optional_debug(func): function a (line 61) | def a(x): function b (line 66) | def b(x, y, z): function c (line 71) | def c(x, y): function optional_debug1 (line 74) | def optional_debug1(func): function add (line 93) | def add(x,y): FILE: cookbook/c09/p12_patch_class.py function log_getattribute (line 9) | def log_getattribute(cls): class A (line 25) | class A: method __init__ (line 26) | def __init__(self, x): method spam (line 29) | def spam(self): FILE: cookbook/c09/p13_instance_create.py class NoInstances (line 9) | class NoInstances(type): method __call__ (line 10) | def __call__(self, *args, **kwargs): class Spam (line 15) | class Spam(metaclass=NoInstances): method grok (line 17) | def grok(x): class Singleton (line 21) | class Singleton(type): method __init__ (line 22) | def __init__(self, *args, **kwargs): method __call__ (line 26) | def __call__(self, *args, **kwargs): class Spam1 (line 35) | class Spam1(metaclass=Singleton): method __init__ (line 36) | def __init__(self): class Cached (line 43) | class Cached(type): method __init__ (line 44) | def __init__(self, *args, **kwargs): method __call__ (line 48) | def __call__(self, *args): class Spam2 (line 58) | class Spam2(metaclass=Cached): method __init__ (line 59) | def __init__(self, name): FILE: cookbook/c09/p14_attribute_order.py class Typed (line 10) | class Typed: method __init__ (line 13) | def __init__(self, name=None): method __set__ (line 16) | def __set__(self, instance, value): class Integer (line 22) | class Integer(Typed): class Float (line 26) | class Float(Typed): class String (line 30) | class String(Typed): class OrderedMeta (line 35) | class OrderedMeta(type): method __new__ (line 36) | def __new__(cls, clsname, bases, clsdict): method __prepare__ (line 47) | def __prepare__(cls, clsname, bases): class Structure (line 51) | class Structure(metaclass=OrderedMeta): method as_csv (line 52) | def as_csv(self): class Stock (line 57) | class Stock(Structure): method __init__ (line 62) | def __init__(self, name, shares, price): FILE: cookbook/c09/p15_meta_optional_arg.py class IStream (line 10) | class IStream(metaclass=ABCMeta): method read (line 12) | def read(self, maxsize=None): method write (line 16) | def write(self, data): class MyMeta (line 19) | class MyMeta(type): method __prepare__ (line 22) | def __prepare__(cls, name, bases, *, debug=False, synchronize=False): method __new__ (line 28) | def __new__(cls, name, bases, ns, *, debug=False, synchronize=False): method __init__ (line 34) | def __init__(self, name, bases, ns, *, debug=False, synchronize=False): FILE: cookbook/c09/p16_enforce_args.py function make_sig (line 11) | def make_sig(*names): class Structure (line 17) | class Structure: method __init__ (line 20) | def __init__(self, *args, **kwargs): method __init__ (line 53) | def __init__(self, *args, **kwargs): class Stock (line 27) | class Stock(Structure): class Point (line 31) | class Point(Structure): function make_sig (line 38) | def make_sig(*names): class StructureMeta (line 44) | class StructureMeta(type): method __new__ (line 45) | def __new__(cls, clsname, bases, clsdict): class Structure (line 50) | class Structure(metaclass=StructureMeta): method __init__ (line 20) | def __init__(self, *args, **kwargs): method __init__ (line 53) | def __init__(self, *args, **kwargs): class Stock (line 60) | class Stock(Structure): class Point (line 64) | class Point(Structure): FILE: cookbook/c09/p17_code_convention.py class MyMeta (line 9) | class MyMeta(type): method __init__ (line 10) | def __init__(self, clsname, bases, clsdict): class Root (line 17) | class Root(metaclass=MyMeta): class A (line 21) | class A(Root): method foo_bar (line 42) | def foo_bar(self): # Ok method foo (line 75) | def foo(self, x, y): method spam (line 78) | def spam(self, x, *, z): class B (line 25) | class B(Root): method fooBar (line 47) | def fooBar(self): # TypeError method foo (line 83) | def foo(self, a, b): method spam (line 86) | def spam(self,x,z): class NoMixedCaseMeta (line 29) | class NoMixedCaseMeta(type): method __new__ (line 30) | def __new__(cls, clsname, bases, clsdict): class Root (line 37) | class Root(metaclass=NoMixedCaseMeta): class A (line 41) | class A(Root): method foo_bar (line 42) | def foo_bar(self): # Ok method foo (line 75) | def foo(self, x, y): method spam (line 78) | def spam(self, x, *, z): class B (line 46) | class B(Root): method fooBar (line 47) | def fooBar(self): # TypeError method foo (line 83) | def foo(self, a, b): method spam (line 86) | def spam(self,x,z): class MatchSignaturesMeta (line 53) | class MatchSignaturesMeta(type): method __init__ (line 55) | def __init__(self, clsname, bases, clsdict): class Root (line 71) | class Root(metaclass=MatchSignaturesMeta): class A (line 74) | class A(Root): method foo_bar (line 42) | def foo_bar(self): # Ok method foo (line 75) | def foo(self, x, y): method spam (line 78) | def spam(self, x, *, z): class B (line 82) | class B(A): method fooBar (line 47) | def fooBar(self): # TypeError method foo (line 83) | def foo(self, a, b): method spam (line 86) | def spam(self,x,z): FILE: cookbook/c09/p18_define_classes.py function __init__ (line 12) | def __init__(self, name, shares, price): function cost (line 18) | def cost(self): function named_tuple (line 38) | def named_tuple(classname, fieldnames): FILE: cookbook/c09/p19_define_init.py class StructTupleMeta (line 11) | class StructTupleMeta(type): method __init__ (line 12) | def __init__(cls, *args, **kwargs): class StructTuple (line 18) | class StructTuple(tuple, metaclass=StructTupleMeta): method __new__ (line 21) | def __new__(cls, *args): class Stock (line 27) | class Stock(StructTuple): class Point (line 31) | class Point(StructTuple): FILE: cookbook/c09/p20_multiple_dispatch.py class MultiMethod (line 13) | class MultiMethod: method __init__ (line 18) | def __init__(self, name): method register (line 22) | def register(self, meth): method __call__ (line 47) | def __call__(self, *args): method __get__ (line 58) | def __get__(self, instance, cls): class MultiDict (line 68) | class MultiDict(dict): method __setitem__ (line 73) | def __setitem__(self, key, value): class MultipleMeta (line 88) | class MultipleMeta(type): method __new__ (line 93) | def __new__(cls, clsname, bases, clsdict): method __prepare__ (line 97) | def __prepare__(cls, clsname, bases): class Spam (line 101) | class Spam(metaclass=MultipleMeta): method bar (line 102) | def bar(self, x:int, y:int): method bar (line 105) | def bar(self, s:str, n:int=0): method bar (line 158) | def bar(self, *args): method bar (line 163) | def bar(self, x, y): method bar (line 167) | def bar(self, s, n=0): class Date (line 112) | class Date(metaclass=MultipleMeta): method __init__ (line 113) | def __init__(self, year: int, month:int, day:int): method __init__ (line 118) | def __init__(self): class multimethod (line 126) | class multimethod: method __init__ (line 127) | def __init__(self, func): method match (line 132) | def match(self, *types): method __call__ (line 141) | def __call__(self, *args): method __get__ (line 149) | def __get__(self, instance, cls): class Spam (line 156) | class Spam: method bar (line 102) | def bar(self, x:int, y:int): method bar (line 105) | def bar(self, s:str, n:int=0): method bar (line 158) | def bar(self, *args): method bar (line 163) | def bar(self, x, y): method bar (line 167) | def bar(self, s, n=0): FILE: cookbook/c09/p21_avoid_repetitive.py class Person (line 9) | class Person: method __init__ (line 10) | def __init__(self, name, age): method name (line 15) | def name(self): method name (line 19) | def name(self, value): method age (line 25) | def age(self): method age (line 29) | def age(self, value): method __init__ (line 56) | def __init__(self, name, age): method __init__ (line 71) | def __init__(self, name, age): function typed_property (line 35) | def typed_property(name, expected_type): class Person (line 52) | class Person: method __init__ (line 10) | def __init__(self, name, age): method name (line 15) | def name(self): method name (line 19) | def name(self, value): method age (line 25) | def age(self): method age (line 29) | def age(self, value): method __init__ (line 56) | def __init__(self, name, age): method __init__ (line 71) | def __init__(self, name, age): class Person (line 67) | class Person: method __init__ (line 10) | def __init__(self, name, age): method name (line 15) | def name(self): method name (line 19) | def name(self, value): method age (line 25) | def age(self): method age (line 29) | def age(self, value): method __init__ (line 56) | def __init__(self, name, age): method __init__ (line 71) | def __init__(self, name, age): FILE: cookbook/c09/p22_context_manager.py function timethis (line 12) | def timethis(label): method __init__ (line 35) | def __init__(self, label): method __enter__ (line 38) | def __enter__(self): method __exit__ (line 41) | def __exit__(self, exc_ty, exc_val, exc_tb): function list_transaction (line 27) | def list_transaction(orig_list): class timethis (line 34) | class timethis: method __init__ (line 35) | def __init__(self, label): method __enter__ (line 38) | def __enter__(self): method __exit__ (line 41) | def __exit__(self, exc_ty, exc_val, exc_tb): FILE: cookbook/c09/p23_local_side.py function test3 (line 8) | def test3(): function test4 (line 18) | def test4(): FILE: cookbook/c09/p24_analyze_source.py class CodeAnalyzer (line 11) | class CodeAnalyzer(ast.NodeVisitor): method __init__ (line 12) | def __init__(self): method visit_Name (line 17) | def visit_Name(self, node): class NameLower (line 51) | class NameLower(ast.NodeVisitor): method __init__ (line 52) | def __init__(self, lowered_names): method visit_FunctionDef (line 55) | def visit_FunctionDef(self, node): function lower_names (line 70) | def lower_names(*namelist): FILE: cookbook/c09/p25_disassemble_bytecode.py function generate_opcodes (line 11) | def generate_opcodes(codebytes): FILE: cookbook/c10/p02_control_import.py function spam (line 9) | def spam(): function grok (line 13) | def grok(): FILE: cookbook/c10/p12_import_patch.py class PostImportFinder (line 15) | class PostImportFinder: method __init__ (line 16) | def __init__(self): method find_module (line 19) | def find_module(self, fullname, path=None): class PostImportLoader (line 26) | class PostImportLoader: method __init__ (line 27) | def __init__(self, finder): method load_module (line 30) | def load_module(self, fullname): function when_imported (line 39) | def when_imported(fullname): function logged (line 54) | def logged(func): function add_logging (line 65) | def add_logging(mod): FILE: cookbook/c12/p01_start_stop_thread.py function countdown (line 4) | def countdown(n): class CountdownTask (line 26) | class CountdownTask: method __init__ (line 27) | def __init__(self): method terminate (line 30) | def terminate(self): method run (line 33) | def run(self, n): class IOTask (line 48) | class IOTask: method terminate (line 49) | def terminate(self): class CountdownThread (line 65) | class CountdownThread(Thread): method __init__ (line 66) | def __init__(self, n): method run (line 70) | def run(self): FILE: exts/chinese_search.py function setup (line 3) | def setup(app): FILE: exts/smallseg.py class SEG (line 12) | class SEG(object): method __init__ (line 13) | def __init__(self): method set (line 25) | def set(self,keywords): method _binary_seg (line 46) | def _binary_seg(self,s): method _pro_unreg (line 56) | def _pro_unreg(self,piece): method cut (line 72) | def cut(self,text): FILE: exts/zh.py class SearchChinese (line 5) | class SearchChinese(SearchLanguage): method init (line 8) | def init(self, options): method split (line 12) | def split(self, input): method word_filter (line 15) | def word_filter(self, stemmed_word): FILE: notebook/fetch_cookbook.py class Chapter (line 55) | class Chapter: method __init__ (line 56) | def __init__(self, chapter_address): method fetch (line 61) | def fetch(self, url): method fetch_list (line 72) | def fetch_list(self): method fetch_sections (line 82) | def fetch_sections(self, sep=False): method fetch_content (line 102) | def fetch_content(self, url): function fetch_all (line 162) | def fetch_all(sep=False):