homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark
Recipients mark
Date 2008年03月13日.08:14:44
SpamBayes Score 0.055408463
Marked as misclassified No
Message-id <1205396087.42.0.232121283205.issue2283@psf.upfronthosting.co.za>
In-reply-to
Content
According to the docs lambda can handle the same parameter list as can
def. But this does not appear to be the case as the following (both
2.5.1 and 30a3) shows:
>>> def f(*a, **kw): return a, kw
>>> f(1,2,a=3,b=4)
((1, 2), {'a': 3, 'b': 4})
>>> A = lambda *a: a
>>> A(1,2)
(1, 2)
>>> K = lambda **k: k
>>> K(a=1,b=2)
{'a': 1, 'b': 2}
>>> X = lambda *a, **k: a, k
Traceback (most recent call last):
 File "<pyshell#17>", line 1, in <module>
 X = lambda *a, **k: a, k
NameError: name 'k' is not defined
So either this is an interpreter bug, or a doc bug.
History
Date User Action Args
2008年03月13日 08:14:48marksetspambayes_score: 0.0554085 -> 0.055408463
recipients: + mark
2008年03月13日 08:14:47marksetspambayes_score: 0.0554085 -> 0.0554085
messageid: <1205396087.42.0.232121283205.issue2283@psf.upfronthosting.co.za>
2008年03月13日 08:14:46marklinkissue2283 messages
2008年03月13日 08:14:45markcreate

AltStyle によって変換されたページ (->オリジナル) /