rright -- thanks Josef,

just for completeness 

$> cat /tmp/1.py
def f(arg1, arg2=1, **kwargs):
    print "got ", arg1, arg2, kwargs

f(0, *(10,), buga=1)

$> python2.5 /tmp/1.py
  File "/tmp/1.py", line 4
    f(0, *(10,), buga=1)
                    ^
SyntaxError: invalid syntax

$> python2.6 /tmp/1.py
got  0 10 {'buga': 1}

On Thu, 08 Dec 2011, [email protected] wrote:

> On Thu, Dec 8, 2011 at 10:51 AM, Gael Varoquaux
> <[email protected]> wrote:
> > On Thu, Dec 08, 2011 at 10:44:23AM -0500, Yaroslav Halchenko wrote:
> >> > and function calls of type 'f(arg1, arg2=1, **kwargs)'.
> >> hm... not sure what you mean (there was some change on how keyword args
> >> are handled but can't recall now), since following snippet works in both

> f(arg1, *args, scale=1)

> explicit keyword after *args

> f(arg1, *args, dict(scale=1))

> Josef


> > OK, so I got it wrong.

> > There is a change in behavior, and some things are possible in Python
> > 2.6+ that are not possible. The problem is that most people (including
> > me) don't have this clearly in mind, and as they are developing under
> > 2.6+, they break 2.5 compatibility without knowing. We find this every
> > once in a while when testing for 2.5 compatibility.

> > G

> > ------------------------------------------------------------------------------
> > Cloud Services Checklist: Pricing and Packaging Optimization
> > This white paper is intended to serve as a reference, checklist and point of
> > discussion for anyone considering optimizing the pricing and packaging model
> > of a cloud services business. Read Now!
> > http://www.accelacomm.com/jaw/sfnl/114/51491232/
> > _______________________________________________
> > Scikit-learn-general mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point of 
> discussion for anyone considering optimizing the pricing and packaging model 
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general


-- 
=------------------------------------------------------------------=
Keep in touch                                     www.onerussian.com
Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to