In the
Yanaconda macro language
you can choose between a single return value and a list
by appending parentheses to the variable name
. This is obviously not possible in Python. Instead those functions that are guaranteed to never return more than one value simply return this value,
while functions possibly returning more than one value always return a list.
# This function never returns a result:
Clear()
# This function always returns a single result, the number of the object loaded:
obj = LoadYOb("crambin")
# This function may return many results (if the PDB file contains an NMR bundle with many MODELs)
objlist = LoadPDB("3gb1")
# Or if you know that the PDB file contains only a single MODEL/object (note the slice [0]):
obj = LoadPDB("1crn")[0]