@@ -152,6 +152,9 @@ def _routing_enabled():
152
152
def request_is_alias (item ):
153
153
"""Check if an item is a valid alias.
154
154
155
+ Values in ``VALID_REQUEST_VALUES`` are not considered aliases in this
156
+ context. Only a string which is a valid identifier is.
157
+
155
158
Parameters
156
159
----------
157
160
item : object
@@ -247,8 +250,9 @@ def add_request(
247
250
"""
248
251
if not request_is_alias (alias ) and not request_is_valid (alias ):
249
252
raise ValueError (
250
- "alias should be either a valid identifier or one of "
251
- "{None, True, False}."
253
+ f"The alias you're setting for `{ param } ` should be either a "
254
+ "valid identifier or one of {None, True, False}, but given "
255
+ f"value is: `{ alias } `"
252
256
)
253
257
254
258
if alias == param :
@@ -659,9 +663,10 @@ class MetadataRouter:
659
663
660
664
def __init__ (self , owner ):
661
665
self ._route_mappings = dict ()
662
- # `_self` is used if the router is also a consumer. _self, (added using
663
- # `add_self_request()`) is treated differently from the other objects
664
- # which are stored in _route_mappings.
666
+ # `_self_request` is used if the router is also a consumer.
667
+ # _self_request, (added using `add_self_request()`) is treated
668
+ # differently from the other objects which are stored in
669
+ # _route_mappings.
665
670
self ._self_request = None
666
671
self .owner = owner
667
672
@@ -1182,8 +1187,8 @@ def _build_request_for_signature(cls, router, method):
1182
1187
"""Build the `MethodMetadataRequest` for a method using its signature.
1183
1188
1184
1189
This method takes all arguments from the method signature and uses
1185
- ``None`` as their default request value, except ``X``, ``y``,
1186
- ``*args``, and ``**kwargs``.
1190
+ ``None`` as their default request value, except ``X``, ``y``, ``Y``,
1191
+ ``Xt``, ``yt``, `` *args``, and ``**kwargs``.
1187
1192
1188
1193
Parameters
1189
1194
----------
@@ -1219,7 +1224,7 @@ def _build_request_for_signature(cls, router, method):
1219
1224
def _get_default_requests (cls ):
1220
1225
"""Collect default request values.
1221
1226
1222
- This method combines the information present in ``metadata_request__ *``
1227
+ This method combines the information present in ``__metadata_request__ *``
1223
1228
class attributes, as well as determining request keys from method
1224
1229
signatures.
1225
1230
"""
0 commit comments