List comprehension for testing **params

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun Nov 11 18:41:46 EST 2012


On Sun, 11 Nov 2012 18:37:05 -0500, Terry Reedy wrote:

> or if you want them to be identified by keyword only (since 7 positional
> args is a bit much)
> 
> def __init__(self, smtp, login, *, subject, from, to, msg):
> 
> (I forget when this feature was added)

It's a Python 3 feature.



-- 
Steven



More information about the Python-list mailing list