You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to question the behavior of the nb_lookup plugin.
If it returns more than one item then it of course returns a list. But if it returns only one item then it does not return a single-element list.
Would it not be more consistent to always return a list, even if it includes only 1 element?
edit: if the API is queried directly with, say, the stock uri module, it is simple to always find json.results a list - even if there is only a single item.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to question the behavior of the
nb_lookup
plugin.If it returns more than one item then it of course returns a list. But if it returns only one item then it does not return a single-element list.
Would it not be more consistent to always return a list, even if it includes only 1 element?
edit: if the API is queried directly with, say, the stock
uri
module, it is simple to always findjson.results
a list - even if there is only a single item.Beta Was this translation helpful? Give feedback.
All reactions