Commit c88bd4a
committed
docs: correct the Python and Go event data model tip
The Python/Go tip in the streaming events reference described a single
`Data` class/struct with every field optional, where fields that are not
populated for an event come back as `None`/`nil`. Both bindings use a
separate data type per event, so code written against that tip does not
work: in Go `event.Data` is the `SessionEventData` interface and reading a
field off it does not compile, and in Python `event.data` is a per-event
dataclass, so reading a field that belongs to another event raises
`AttributeError` instead of returning `None`.
The tip was accurate when it was added and went stale when both bindings
moved to per-event data types. Describe the per-event model instead, using
the wording the same file already uses for .NET, and correct the copy of
the same sentence that the docs style guide uses as its example of a
language-qualified callout.1 parent f6fea8d commit c88bd4a
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| |||
0 commit comments