Repository navigation
Add a typed codec that rebuilds a message without running code - #460
Closed
johnsabath wants to merge 2 commits into
Closed
johnsabath wants to merge 2 commits into
johnsabath wants to merge 2 commits into
Conversation
reactor_runtime.ipc.typed encodes an object as a tree of typed values: None, bool, int, float, str, bytes, numpy arrays and scalars of a fixed dtype list, list, tuple, dict, and the dataclasses and enums registered with @payload_type. Arrays go into the writer's SharedSlot as they do with pack(), or inline when there is no slot. The reader builds only those types. It checks every length against the frame, every array's shape against its bytes, every span against the block, and the nesting depth, and it refuses an unregistered type by name. pickle imports any class a frame names and calls what the frame tells it to, so a reader that must not trust its writer cannot use it. Nothing uses the codec yet; the model server's link takes it in the next change. Signed-off-by: John Sabath <john@reactor.inc>
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…tity A combined or unnamed Flag value encoded as "A|B" and could not decode, so encode now refuses it and names the fix. A dict key check compared types with ==, which a metaclass can override; it now compares by identity. A deeply nested tuple key raised RecursionError; the check now stops at MAX_DEPTH. The error for a bad enum member no longer renders the decoded value, so no registered __repr__ runs. Signed-off-by: John Sabath <john@reactor.inc>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closed.