#15993: Python 3 preparation: Remove implicit tuple parameter unpacking
--------------------------------+------------------------
Reporter: wluebbe | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.2
Component: distribution | Resolution:
Keywords: python3 | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
--------------------------------+------------------------
Description changed by wluebbe:
Old description:
> The old syntax no more supported by Python 3.
>
> Changes according to {{{lib2to3/fixes/fix_tuple_params.py}}}:
> {{{
> Fixer for function definitions with tuple parameters:
> Replace
> def func(((a, b), c), d):
> ...
> with
> def func(x, d):
> ((a, b), c) = x
> ...
>
> It will also support lambdas:
> lambda (x, y): x + y -> lambda t: t[0] + t[1]
> # The parens are a syntax error in Python 3
> lambda (x): x + y -> lambda x: x + y
> }}}
New description:
The old syntax no more supported by Python 3.
Changes according to {{{lib2to3/fixes/fix_tuple_params.py}}}:
{{{
Fixer for function definitions with tuple parameters:
Replace
def func(((a, b), c), d):
...
with
def func(x, d):
((a, b), c) = x
...
It will also support lambdas:
lambda (x, y): x + y -> lambda t: t[0] + t[1]
# The parens are a syntax error in Python 3
lambda (x): x + y -> lambda x: x + y
}}}
This ticket is tracked as a dependency of meta-ticket ticket:15980.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/15993#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.