{"action":"created","issue":{"url":"https://api.github.com/repos/google/protobuf/issues/4444","repository_url":"https://api.github.com/repos/google/protobuf","labels_url":"https://api.github.com/repos/google/protobuf/issues/4444/labels{/name}","comments_url":"https://api.github.com/repos/google/protobuf/issues/4444/comments","events_url":"https://api.github.com/repos/google/protobuf/issues/4444/events","html_url":"https://github.com/google/protobuf/issues/4444","id":309163995,"number":4444,"title":"set a protocol buffer field to None in python","user":{"login":"lukekingbru","id":4403510,"avatar_url":"https://avatars2.githubusercontent.com/u/4403510?v=4","gravatar_id":"","url":"https://api.github.com/users/lukekingbru","html_url":"https://github.com/lukekingbru","followers_url":"https://api.github.com/users/lukekingbru/followers","following_url":"https://api.github.com/users/lukekingbru/following{/other_user}","gists_url":"https://api.github.com/users/lukekingbru/gists{/gist_id}","starred_url":"https://api.github.com/users/lukekingbru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukekingbru/subscriptions","organizations_url":"https://api.github.com/users/lukekingbru/orgs","repos_url":"https://api.github.com/users/lukekingbru/repos","events_url":"https://api.github.com/users/lukekingbru/events{/privacy}","received_events_url":"https://api.github.com/users/lukekingbru/received_events","type":"User","site_admin":false},"labels":[{"id":250677130,"url":"https://api.github.com/repos/google/protobuf/labels/python","name":"python","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"anandolee","id":11618033,"avatar_url":"https://avatars0.githubusercontent.com/u/11618033?v=4","gravatar_id":"","url":"https://api.github.com/users/anandolee","html_url":"https://github.com/anandolee","followers_url":"https://api.github.com/users/anandolee/followers","following_url":"https://api.github.com/users/anandolee/following{/other_user}","gists_url":"https://api.github.com/users/anandolee/gists{/gist_id}","starred_url":"https://api.github.com/users/anandolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandolee/subscriptions","organizations_url":"https://api.github.com/users/anandolee/orgs","repos_url":"https://api.github.com/users/anandolee/repos","events_url":"https://api.github.com/users/anandolee/events{/privacy}","received_events_url":"https://api.github.com/users/anandolee/received_events","type":"User","site_admin":false},"assignees":[{"login":"anandolee","id":11618033,"avatar_url":"https://avatars0.githubusercontent.com/u/11618033?v=4","gravatar_id":"","url":"https://api.github.com/users/anandolee","html_url":"https://github.com/anandolee","followers_url":"https://api.github.com/users/anandolee/followers","following_url":"https://api.github.com/users/anandolee/following{/other_user}","gists_url":"https://api.github.com/users/anandolee/gists{/gist_id}","starred_url":"https://api.github.com/users/anandolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandolee/subscriptions","organizations_url":"https://api.github.com/users/anandolee/orgs","repos_url":"https://api.github.com/users/anandolee/repos","events_url":"https://api.github.com/users/anandolee/events{/privacy}","received_events_url":"https://api.github.com/users/anandolee/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-03-27T23:03:25Z","updated_at":"2018-05-03T23:11:27Z","closed_at":null,"author_association":"NONE","body":"in proto 3\r\n\r\nI have this object \r\n\r\nmessage act {\r\n    bytes                                      act_cmd          = 1;\r\n}\r\n\r\nIn python code:\r\nhope to do this \r\n\r\nact_inst = act()\r\nact_inst.act_cmd = None <<<<<<<<<<<<<<<<<<< throw error\r\n\r\n/google/protobuf/internal/type_checkers.py\", line 109, in CheckValue\\n    raise TypeError(message)\\nTypeError: None has type <type \\'NoneType\\'>, but expected one of: ((<type \\'str\\'>,),)\r\n\r\nIs anyway to get rid of this error? Or there is some data type I can use in protocol buffer, which can accept string or None value ?\r\n\r\n\r\nin python give None value to a string variable is allowed.\r\n\r\n>>> s = str()\r\n>>> type(s)\r\n<type 'str'>\r\n>>> \r\n>>> s = None\r\n>>> type(s)\r\n<type 'NoneType'>\r\n\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/google/protobuf/issues/comments/386463881","html_url":"https://github.com/google/protobuf/issues/4444#issuecomment-386463881","issue_url":"https://api.github.com/repos/google/protobuf/issues/4444","id":386463881,"user":{"login":"anandolee","id":11618033,"avatar_url":"https://avatars0.githubusercontent.com/u/11618033?v=4","gravatar_id":"","url":"https://api.github.com/users/anandolee","html_url":"https://github.com/anandolee","followers_url":"https://api.github.com/users/anandolee/followers","following_url":"https://api.github.com/users/anandolee/following{/other_user}","gists_url":"https://api.github.com/users/anandolee/gists{/gist_id}","starred_url":"https://api.github.com/users/anandolee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anandolee/subscriptions","organizations_url":"https://api.github.com/users/anandolee/orgs","repos_url":"https://api.github.com/users/anandolee/repos","events_url":"https://api.github.com/users/anandolee/events{/privacy}","received_events_url":"https://api.github.com/users/anandolee/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T23:11:27Z","updated_at":"2018-05-03T23:11:27Z","author_association":"CONTRIBUTOR","body":"Are you using protobuf/python/google/protobuf/json_format.py?\r\n\r\nAccording to our JSON Mapping document, null is accepted:\r\nhttps://developers.google.com/protocol-buffers/docs/proto3#json"}}
{"actor":{"display_login":"anandolee"}}