From 62595ffc3b8c018b417a37de045e16f9f7992e1b Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Sun, 24 Jul 2022 22:02:48 +0300 Subject: [PATCH] docs: explain why impl has no public attributes property Signed-off-by: Alexander Tkachev --- cloudevents/abstract/event.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cloudevents/abstract/event.py b/cloudevents/abstract/event.py index 98143d5..c295d57 100644 --- a/cloudevents/abstract/event.py +++ b/cloudevents/abstract/event.py @@ -44,6 +44,12 @@ class CloudEvent(abc.ABC): We don't wont to restrict our future selves. When a write model will be needed, it will be implemented + + The we don't have an `attributes` property is to prevent API confusion + Examples of confusion: + * What is the difference between `event.get("myattr")` and + `event.attributes.get("myattr")` + * What SHOULD I use `event["myattr"]` or `event.attributes["myattr"]` ? """ pass