Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Sam Alexander
3,296 PointsChaining functions in Python
When chaining functions in Python, i.e. using map and filter, what is the order that they are run in? is it inside out or outside in?
1 Answer
Steven Parker
243,318 PointsChains are evaluated left-to-right:
myvar = object.do_first(x).do_second(y).do_last(z)
I'm not sure how the terms inside and outside apply to a chain. That sounds more like argument passing (which is evaluated inside-out):
myvar = do_last(do_second(do_first(object)))