Support expand in python retrieval.