From 1d5cfac278192924542f3e80922b467479f8e9e6 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 4 Apr 2024 09:24:40 +0100 Subject: [PATCH] How about JSON? --- AnsibleUnsafe-notes.rest | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AnsibleUnsafe-notes.rest b/AnsibleUnsafe-notes.rest index b5a3d55..609c604 100644 --- a/AnsibleUnsafe-notes.rest +++ b/AnsibleUnsafe-notes.rest @@ -212,3 +212,16 @@ Informed guesses of rules/design principals - All templating should/does happen on the controller (80% sure). - Ansible targets cannot/should not try to mark a value as safe or unsafe. The controller couldn't trust that determination anyway. + +Ideas +----- + +Could the current dispatch table/`isinstance()` approach be replaced by a +roundtrip through JSON? E.g. + +.. code:: + + def cast(obj): + return json.loads(json.dumps(obj)) + +Would it be faster/slower?