[Checkins] [zopefoundation/RestrictedPython] 31bf2a: Rewrite the mechanism of tuple parameter unpacking...

GitHub noreply at github.com
Sun Oct 23 18:20:17 CEST 2016


  Branch: refs/heads/Python3_update
  Home:   https://github.com/zopefoundation/RestrictedPython
  Commit: 31bf2ae543d6323f51e8d622822c15bdc61b8389
      https://github.com/zopefoundation/RestrictedPython/commit/31bf2ae543d6323f51e8d622822c15bdc61b8389
  Author: stephan-hof <sh at axiros.com>
  Date:   2016-10-23 (Sun, 23 Oct 2016)

  Changed paths:
    M src/RestrictedPython/transformer.py

  Log Message:
  -----------
  Rewrite the mechanism of tuple parameter unpacking.

The previous way worked great if there was a body to append the unpack statements.
Unfortunately, tuple parameters are also allowed as parameters for  lambda
functions. lambda functions don't have a body where statements are allowed :(
=> No way to use the existing code.

The new way wraps the tuple unpacking into a single expresion, by using nested
lambdas. This expression can now be used wrap tuple parameters of lambda
functions.


  Commit: 4c2b2d401ffa8eab4c84cc852da6737c30d26239
      https://github.com/zopefoundation/RestrictedPython/commit/4c2b2d401ffa8eab4c84cc852da6737c30d26239
  Author: stephan-hof <sh at axiros.com>
  Date:   2016-10-23 (Sun, 23 Oct 2016)

  Changed paths:
    M src/RestrictedPython/transformer.py
    M tests/test_transformer.py

  Log Message:
  -----------
  Check parameter names of lambda functions.


  Commit: 652c7d975f89aec3dc19dc0b778f09059c995f78
      https://github.com/zopefoundation/RestrictedPython/commit/652c7d975f89aec3dc19dc0b778f09059c995f78
  Author: stephan-hof <sh at axiros.com>
  Date:   2016-10-23 (Sun, 23 Oct 2016)

  Changed paths:
    M src/RestrictedPython/transformer.py
    M tests/test_transformer.py

  Log Message:
  -----------
  Protect 'tuple parameter unpacking' on lambda functions.


Compare: https://github.com/zopefoundation/RestrictedPython/compare/4ed102e58f43...652c7d975f89


More information about the checkins mailing list