From f34cddde2e2e36205269dacd5e72967ad1d12358 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Tue, 16 Jul 2019 09:50:04 -0400
Subject: [PATCH] Better explain the argument shuffling

---
 src/_secureaccesstokenauthorizer/_storage_server.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/_secureaccesstokenauthorizer/_storage_server.py b/src/_secureaccesstokenauthorizer/_storage_server.py
index 46907a2..ed44a7e 100644
--- a/src/_secureaccesstokenauthorizer/_storage_server.py
+++ b/src/_secureaccesstokenauthorizer/_storage_server.py
@@ -100,9 +100,14 @@ def add_arguments(schema, kwargs):
     new_kwargs.update(kwargs)
     modified_schema = RemoteMethodSchema(**new_kwargs)
     # Initialized from **new_kwargs, RemoteMethodSchema.argumentNames is in
-    # some arbitrary, probably-incorrect order.  Fix it.
+    # some arbitrary, probably-incorrect order.  This breaks user code which
+    # tries to use positional arguments.  Put them back in the order they were
+    # in originally (in the input ``schema``), prepended with the newly added
+    # arguments.
     modified_schema.argumentNames = (
+        # The new arguments
         list(argName for (argName, _) in kwargs) +
+        # The original arguments in the original order
         schema.argumentNames
     )
     return modified_schema
-- 
GitLab