Consider Atom to be a class where
- form.name is a string
- convert returns a list of values
What is the difference between the following two lines?
apply(Atom, [form.name] + list([convert(arg, subst) for arg in list(form.args)]))
Atom(form.name, [convert(arg, subst) for arg in form.args])
From documentation,
apply(...) apply(object[, args[, kwargs]]) -> value
Call a callable object with positional arguments taken from the tuple args, and keyword arguments taken from the optional dictionary kwargs. Note that classes are callable, as are instances with a call() method.
I am not able to understand the difference between the two lines. I am trying to find an equivalent code for apply(Atom, [form.name] + list([convert(arg, subst) for arg in list(form.args)]))
in Python 3.5