From 2d4ffed63baae21f52359458a451fe6864c04994 Mon Sep 17 00:00:00 2001 From: Piotr Maslanka <piotr.maslanka@henrietta.com.pl> Date: Sun, 5 Feb 2017 04:49:17 +0100 Subject: [PATCH] memoryviews will stay --- docs/caveats.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/caveats.md b/docs/caveats.md index eefe3ef..6ba5711 100644 --- a/docs/caveats.md +++ b/docs/caveats.md @@ -20,3 +20,10 @@ Note that YOU, when sending messages, should not use memoryviews. Pass proper by as required. _AMQPError_'s returned to you via futures will also have memoryviews as _reply_text_! + +It was considered whether to unserialize short fields, such as _routing_key_ or _exchange_, but it was decided against. +Creating a new memoryview carries at least much overhead as an empty string, but there's no need to copy. +Plus, it's not known whether you will use these strings at all! + +If you need to, you got memoryviews. Plus they support the \__eq__ protocol, which should cover most +use cases without even converting. -- GitLab