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 Julien.Palard
Recipients Arfrever, Julien.Palard, Ramchandra Apte, brian.curtin, eric.araujo, eric.snow, ezio.melotti, gregory.p.smith, gruszczy, meatballhat, rhettinger
Date 2014-07-21.10:13:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405937634.01.0.917053924496.issue8706@psf.upfronthosting.co.za>
In-reply-to
Content
I think for some builtins it may be usefull to have keyword arguments, in the case they take more than one parameter.

Typically, it's impossible to write:

    self.drop_elements(partial(isinstance, type(lxml.etree.Comment)))

Because isinstance take its argument in the "other" order, we may bypass this using keywords arguments:


    self.drop_elements(partial(isinstance, type=type(lxml.etree.Comment)))

But isinstance refuses keyword arguments, so there is no way to write this without a lambda:

    self.drop_elements(lambda x: isinstance(x,
                       type(lxml.etree.Comment)))

With is cool and work, I agree, it's just an example to explicitly show why keywords argument may be cool: functools.partial.
History
Date User Action Args
2014-07-21 10:13:54Julien.Palardsetrecipients: + Julien.Palard, rhettinger, gregory.p.smith, ezio.melotti, eric.araujo, Arfrever, brian.curtin, gruszczy, meatballhat, eric.snow, Ramchandra Apte
2014-07-21 10:13:54Julien.Palardsetmessageid: <1405937634.01.0.917053924496.issue8706@psf.upfronthosting.co.za>
2014-07-21 10:13:53Julien.Palardlinkissue8706 messages
2014-07-21 10:13:53Julien.Palardcreate