Python vs. Io

Andrew Bennetts andrew-pythonlist at puzzling.org
Sun Feb 1 02:35:15 CET 2004


On Sat, Jan 31, 2004 at 03:38:02PM -0500, Jp Calderone wrote:
> On Sat, Jan 31, 2004 at 12:20:52PM -0800, Daniel Ehrenberg wrote:
> > 
> > What are you talking about? There's tons of new "magical syntax" in
> > Python. Examples for "magical syntax" features that don't work on
> > 1.5.2 include:
[...]
> 
> > * * and ** in function declarations
> 
>   Yep.

* and ** in function _calls_ is new in 2.0, but in declarations was already
there in 1.5.2:

bash-2.05b$ python1.5
Python 1.5.2 (#0, Jul  5 2003, 11:45:08)  [GCC 3.3.1 20030626 (Debian prerelease)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> def f(*args, **kwargs):
...     print args, kwargs
... 
>>> f('a', 'b', 'c', x=1, y=2, z=3)
('a', 'b', 'c') {'z': 3, 'x': 1, 'y': 2}
>>> 

-Andrew.





More information about the Python-list mailing list