Skip to content
  • Scott Wegner's avatar
    Support dict-like syntax for extracting values from AnonymousTuple by key. · ef39a39e
    Scott Wegner authored
    This is a convenience for working with the output of a federated computation, which is generally returned as a nested AnonymousTuple structure. Now, individual values can be extracted from the structure using:
    
      result = my_federated_computation()
      pprint(result['foo'])
    
    This was previously possible using `getattr(result, 'foo')`; this change makes the existing functionality more discoverable.
    
    PiperOrigin-RevId: 299964819
    ef39a39e