-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nextgen Proto Pythonic API: Struct/ListValue assignment and creation
Python dict is now able to be assigned (by create and copy, not reference) and compared with the Protobuf Struct field. Python list is now able to be assigned (by create and copy, not reference) and compared with the Protobuf ListValue field. example usage: dictionary = {'key1': 5.0, 'key2': {'subkey': 11.0, 'k': False},} list_value = [6, 'seven', True, False, None, dictionary] msg = more_messages_pb2.WKTMessage( optional_struct=dictionary, optional_list_value=list_value ) self.assertEqual(msg.optional_struct, dictionary) self.assertEqual(msg.optional_list_value, list_value) PiperOrigin-RevId: 646099987
- Loading branch information
1 parent
0302c4c
commit e17821c
Showing
7 changed files
with
256 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.