purcell / airspeed

A lightweight Python template engine compatible with Velocity, used in OpenStack
Other
91 stars 37 forks source link

Support index-based extraction of array elements returned from functions #48

Closed whummer closed 2 years ago

whummer commented 3 years ago

Thanks for providing this brilliant library @purcell ! 🙏

This PR adds support for index-based extraction of array elements returned from functions. Example:

func_that_returns_an_array(...)[1]
calvernaz commented 2 years ago

Hi @purcell, it's been a long time since @whummer proposed this PR. There are unit tests that should cover this functionality, are you happy to merge it? :+1:

purcell commented 2 years ago

Done, thanks. I tried a different implementation, and concluded the proposed approach was the best. Also added an extra test case.