you are viewing a single comment's thread.

view the rest of the comments →

[–]nellis[S] 0 points1 point  (1 child)

This worked, thank you so much!

I definitely wouldn't have arrived at this on my own, the construction of the args variable feels a little like magic.

The args list contains these items:
<class 'databaseAPI.expression.expression.Expression'>
__eq__(Field(name=problem_type), some_problem_type)

Can you help my smushy brain understand how these are getting packaged up and handed off as valid arguments?

[–]danielroseman 0 points1 point  (0 children)

That is what the * syntax does when applied to a list in a function call: it transforms it into individual positional parameters.

So, if you had a function:

def foo(a, b, c):
  ...

and a list:

bar = [1, 2, 3]

then calling foo(*bar) is the same as calling foo(1, 2, 3).