8000 Remove serialized_on_wire from documentation · AdrienVannson/python-betterproto@64e6dc1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 64e6dc1

Browse files
committed
Remove serialized_on_wire from documentation
1 parent f56f63d commit 64e6dc1

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,6 @@ For compatibility the default is to convert field names to `camelCase`. You can
248248
MyMessage().to_dict(casing=betterproto.Casing.SNAKE)
249249
```
250250

251-
### Determining if a message was sent
252-
253-
Sometimes it is useful to be able to determine whether a message has been sent on the wire. This is how the Google wrapper types work to let you know whether a value is unset, set as the default (zero value), or set as something else, for example.
254-
255-
Use `betterproto.serialized_on_wire(message)` to determine if it was sent. This is a little bit different from the official Google generated Python code, and it lives outside the generated `Message` class to prevent name clashes. Note that it **only** supports Proto 3 and thus can **only** be used to check if `Message` fields are set. You cannot check if a scalar was sent on the wire.
256-
257-
```py
258-
# Old way (official Google Protobuf package)
259-
>>> mymessage.HasField('myfield')
260-
261-
# New way (this project)
262-
>>> betterproto.serialized_on_wire(mymessage.myfield)
263-
```
264-
265251
### One-of Support
266252

267253
Protobuf supports grouping fields in a `oneof` clause. Only one of the fields in the group may be set at a given time. For example, given the proto:

docs/migrating.rst

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,6 @@ regenerating your protobufs of course) although there are some minor differences
1919
:meth:`betterproto.Message.__bytes__` respectively.
2020

2121

22-
Determining if a message was sent
23-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24-
25-
Sometimes it is useful to be able to determine whether a message has been sent on
26-
the wire. This is how the Google wrapper types work to let you know whether a value is
27-
unset (set as the default/zero value), or set as something else, for example.
28-
29-
Use ``betterproto.serialized_on_wire(message)`` to determine if it was sent. This is
30-
a little bit different from the official Google generated Python code, and it lives
31-
outside the generated ``Message`` class to prevent name clashes. Note that it only
32-
supports Proto 3 and thus can only be used to check if ``Message`` fields are set.
33-
You cannot check if a scalar was sent on the wire.
34-
35-
.. code-block:: python
36-
37-
# Old way (official Google Protobuf package)
38-
>>> mymessage.HasField('myfield')
39-
True
40-
41-
# New way (this project)
42-
>>> betterproto.serialized_on_wire(mymessage.myfield)
43-
True
44-
45-
4622
One-of Support
4723
~~~~~~~~~~~~~~
4824

0 commit comments

Comments
 (0)
0