]> git.ipfire.org Git - thirdparty/jinja.git/commit
More closely match python splatting for calls 802/head
authorToshio Kuratomi <a.badger@gmail.com>
Mon, 29 Jan 2018 23:44:46 +0000 (15:44 -0800)
committerToshio Kuratomi <a.badger@gmail.com>
Mon, 29 Jan 2018 23:44:46 +0000 (15:44 -0800)
commitd6c016ba777aae9ac7f15afe3fabe9a54367fcde
tree590b869671ed9f3bab6bb223a760d9ca614f8e4d
parent96cd53d8fffb20863246357d54865f8b87ec625c
More closely match python splatting for calls

In Python, it's legal to use splats in function calls like this:

  call_function('123', *b, c=5, **d)

Prior to this change, jinja2 did not allow that. It mandated that all
splatting had to take place at the end of the call:

  call_function('123', c=5, *b, **d)

This commit allows both orders.

Additionally, this commit adds tests for more things that are illegal:
namely giving a function a positional argument after using a splat to
unpack positional arguments or giving a function a named argument after
using a double splat to unpack keyword arguments.
jinja2/parser.py
tests/test_lexnparse.py