コード例 #1
0
ファイル: opcodes.py プロジェクト: CSberger/DataflowPythonSDK
def symmetric_binary_op(state, unused_arg):
  # TODO(robertwb): This may not be entirely correct...
  b, a = state.stack.pop(), state.stack.pop()
  if a == b:
    state.stack.append(a)
  elif type(a) == type(b) and isinstance(a, typehints.SequenceTypeConstraint):
    state.stack.append(type(a)(union(element_type(a), element_type(b))))
  else:
    state.stack.append(Any)
コード例 #2
0
ファイル: opcodes.py プロジェクト: kobisalant/incubator-beam
def symmetric_binary_op(state, unused_arg):
    # TODO(robertwb): This may not be entirely correct...
    b, a = state.stack.pop(), state.stack.pop()
    if a == b:
        state.stack.append(a)
    elif type(a) == type(b) and isinstance(a,
                                           typehints.SequenceTypeConstraint):
        state.stack.append(type(a)(union(element_type(a), element_type(b))))
    else:
        state.stack.append(Any)
コード例 #3
0
ファイル: opcodes.py プロジェクト: CSberger/DataflowPythonSDK
def binary_true_divide(state, unused_arg):
  u = union(state.stack.pop(), state.stack.pop)
  if u == int:
    state.stack.append(float)
  else:
    state.stack.append(u)
コード例 #4
0
ファイル: opcodes.py プロジェクト: kobisalant/incubator-beam
def binary_true_divide(state, unused_arg):
    u = union(state.stack.pop(), state.stack.pop)
    if u == int:
        state.stack.append(float)
    else:
        state.stack.append(u)