apache_beam.typehints.opcodes module

Defines the actions various bytecodes have on the frame.

Each function here corresponds to a bytecode documented in https://docs.python.org/2/library/dis.html or https://docs.python.org/3/library/dis.html. The first argument is a (mutable) FrameState object, the second the integer opcode argument.

Bytecodes with more complicated behavior (e.g. modifying the program counter) are handled inline rather than here.

For internal use only; no backwards-compatibility guarantees.

apache_beam.typehints.opcodes.pop_one(state, unused_arg)[source]
apache_beam.typehints.opcodes.pop_two(state, unused_arg)[source]
apache_beam.typehints.opcodes.pop_three(state, unused_arg)[source]
apache_beam.typehints.opcodes.push_value(v)[source]
apache_beam.typehints.opcodes.nop(unused_state, unused_arg)[source]
apache_beam.typehints.opcodes.pop_top(state, unused_arg)[source]
apache_beam.typehints.opcodes.rot_n(state, n)[source]
apache_beam.typehints.opcodes.rot_two(state, unused_arg)[source]
apache_beam.typehints.opcodes.rot_three(state, unused_arg)[source]
apache_beam.typehints.opcodes.rot_four(state, unused_arg)[source]
apache_beam.typehints.opcodes.dup_top(state, unused_arg)[source]
apache_beam.typehints.opcodes.unary(state, unused_arg)[source]
apache_beam.typehints.opcodes.unary_positive(state, unused_arg)
apache_beam.typehints.opcodes.unary_negative(state, unused_arg)
apache_beam.typehints.opcodes.unary_invert(state, unused_arg)
apache_beam.typehints.opcodes.unary_not(state, unused_arg)[source]
apache_beam.typehints.opcodes.unary_convert(state, unused_arg)[source]
apache_beam.typehints.opcodes.get_iter(state, unused_arg)[source]
apache_beam.typehints.opcodes.symmetric_binary_op(state, unused_arg)[source]
apache_beam.typehints.opcodes.binary_power(state, unused_arg)
apache_beam.typehints.opcodes.inplace_power(state, unused_arg)
apache_beam.typehints.opcodes.binary_multiply(state, unused_arg)
apache_beam.typehints.opcodes.inplace_multiply(state, unused_arg)
apache_beam.typehints.opcodes.binary_divide(state, unused_arg)
apache_beam.typehints.opcodes.inplace_divide(state, unused_arg)
apache_beam.typehints.opcodes.binary_floor_divide(state, unused_arg)
apache_beam.typehints.opcodes.inplace_floor_divide(state, unused_arg)
apache_beam.typehints.opcodes.binary_true_divide(state, unused_arg)[source]
apache_beam.typehints.opcodes.inplace_true_divide(state, unused_arg)
apache_beam.typehints.opcodes.binary_modulo(state, unused_arg)
apache_beam.typehints.opcodes.inplace_modulo(state, unused_arg)
apache_beam.typehints.opcodes.binary_add(state, unused_arg)
apache_beam.typehints.opcodes.inplace_add(state, unused_arg)
apache_beam.typehints.opcodes.binary_subtract(state, unused_arg)
apache_beam.typehints.opcodes.inplace_subtract(state, unused_arg)
apache_beam.typehints.opcodes.binary_subscr(state, unused_arg)[source]
apache_beam.typehints.opcodes.binary_lshift(state, unused_arg)
apache_beam.typehints.opcodes.inplace_lshift(state, unused_arg)
apache_beam.typehints.opcodes.binary_rshift(state, unused_arg)
apache_beam.typehints.opcodes.inplace_rshift(state, unused_arg)
apache_beam.typehints.opcodes.binary_and(state, unused_arg)
apache_beam.typehints.opcodes.inplace_and(state, unused_arg)
apache_beam.typehints.opcodes.binary_xor(state, unused_arg)
apache_beam.typehints.opcodes.inplace_xor(state, unused_arg)
apache_beam.typehints.opcodes.binary_or(state, unused_arg)
apache_beam.typehints.opcodes.inpalce_or(state, unused_arg)
apache_beam.typehints.opcodes.store_subscr(unused_state, unused_args)[source]
apache_beam.typehints.opcodes.print_item(state, unused_arg)
apache_beam.typehints.opcodes.print_newline(unused_state, unused_arg)
apache_beam.typehints.opcodes.list_append(state, arg)[source]
apache_beam.typehints.opcodes.map_add(state, arg)[source]
apache_beam.typehints.opcodes.load_locals(state, unused_arg)
apache_beam.typehints.opcodes.exec_stmt(state, unused_arg)
apache_beam.typehints.opcodes.build_class(state, unused_arg)
apache_beam.typehints.opcodes.unpack_sequence(state, arg)[source]
apache_beam.typehints.opcodes.dup_topx(state, arg)[source]
apache_beam.typehints.opcodes.store_attr(state, unused_arg)
apache_beam.typehints.opcodes.delete_attr(unused_state, unused_arg)
apache_beam.typehints.opcodes.store_global(state, unused_arg)
apache_beam.typehints.opcodes.delete_global(unused_state, unused_arg)
apache_beam.typehints.opcodes.load_const(state, arg)[source]
apache_beam.typehints.opcodes.load_name(state, unused_arg)
apache_beam.typehints.opcodes.build_tuple(state, arg)[source]
apache_beam.typehints.opcodes.build_list(state, arg)[source]
apache_beam.typehints.opcodes.build_map(state, arg)[source]
apache_beam.typehints.opcodes.build_const_key_map(state, arg)[source]
apache_beam.typehints.opcodes.load_attr(state, arg)[source]

Replaces the top of the stack, TOS, with getattr(TOS, co_names[arg])

Will replace with Any for builtin methods, but these don’t have bytecode in CPython so that’s okay.

apache_beam.typehints.opcodes.load_method(state, arg)[source]

Like load_attr. Replaces TOS object with method and TOS.

apache_beam.typehints.opcodes.compare_op(state, unused_arg)[source]
apache_beam.typehints.opcodes.import_name(state, unused_arg)[source]
apache_beam.typehints.opcodes.import_from(state, unused_arg)
apache_beam.typehints.opcodes.load_global(state, arg)[source]
apache_beam.typehints.opcodes.store_map(state, unused_arg)
apache_beam.typehints.opcodes.load_fast(state, arg)[source]
apache_beam.typehints.opcodes.store_fast(state, arg)[source]
apache_beam.typehints.opcodes.delete_fast(state, arg)[source]
apache_beam.typehints.opcodes.load_closure(state, arg)[source]
apache_beam.typehints.opcodes.load_deref(state, arg)[source]
apache_beam.typehints.opcodes.make_function(state, arg)[source]

Creates a function with the arguments at the top of the stack.

apache_beam.typehints.opcodes.make_closure(state, arg)[source]
apache_beam.typehints.opcodes.build_slice(state, arg)[source]
apache_beam.typehints.opcodes.build_list_unpack(state, arg)[source]

Joins arg count iterables from the stack into a single list.

apache_beam.typehints.opcodes.build_tuple_unpack(state, arg)[source]

Joins arg count iterables from the stack into a single tuple.

apache_beam.typehints.opcodes.build_tuple_unpack_with_call(state, arg)[source]

Same as build_tuple_unpack, with an extra fn argument at the bottom of the stack, which remains untouched.