Issue1924

classification
Title: Implement operator.methodcaller
Type: Severity: normal
Components: Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, int3, pjenvey
Priority: normal Keywords:

Created on 2012-06-15.12:07:33 by int3, last changed 2012-06-27.18:33:47 by fwierzbicki.

Files
File name Uploaded Description Edit Remove
methodcaller int3, 2012-06-15.12:07:33 Patch
methodcaller int3, 2012-06-16.09:01:02
Messages
msg7224 (view) Author: Jez Ng (int3) Date: 2012-06-15.12:07:33
Implement operator.methodcaller.
msg7225 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-06-15.17:06:48
Hi Jez Ng! Have you signed a PSF contributor agreement? The size of this patch is right on the edge of where I'd want one -- see http://www.python.org/psf/contrib/ for instructions and rationale, and see http://www.python.org/psf/contrib/ for the actual form. If it doesn't print out well for you I have a pdf version somewhere.
msg7226 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-06-15.17:09:46
Jez Ng, do you work at Mozilla? Mozilla might have a company wide contributor agreement if you want to submit this as a Mozilla employee.
msg7228 (view) Author: Philip Jenvey (pjenvey) Date: 2012-06-15.18:36:29
Thanks for this,

You probably don't want to convert via __tojava__(String.class). ArgParser can return you a String in a nicer fashion, but you might also need to consider unicode values like attrgetter does (unfortunately there's no tests for unicode name values)

I probably would have used the simpler/faster StringTokenizer instead of String split but that's not too big of a deal.

And please wrap all blocks with curly braces according to the coding standards: http://wiki.python.org/jython/CodingStandards
msg7229 (view) Author: Philip Jenvey (pjenvey) Date: 2012-06-15.18:38:58
You should re-enable the attrgetter test too along w/ its fix
msg7230 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-06-15.21:41:32
BTW I should have started with a "Thanks for this!" as Philip did before launching into annoying legal stuff, so sorry about that :)
msg7231 (view) Author: Jez Ng (int3) Date: 2012-06-16.03:48:05
> Hi Jez Ng! Have you signed a PSF contributor agreement?

Not yet. I'll get it done on Monday -- don't have access to a printer over the weekend. I'm not a Mozilla employee, though I did intern there last summer.

> You probably don't want to convert via __tojava__(String.class). ArgParser can return you a String in a nicer fashion,

I'm not sure if I misread the code, but it looks like ArgParser checks that the arguments correspond to a whitelist of keyword arguments. Is there a way to make it accept an arbitrary number of such arguments?

> You should re-enable the attrgetter test too along w/ its fix

Oops, the attrgetter code shouldn't have been included in this patch... that code was carried over from the patch to issue 1909. I'm generally a git user, and hg confused me.

> BTW I should have started with a "Thanks for this!" as Philip did before launching into annoying legal stuff, so sorry about that :)

No problem at all. Thanks for the quick patch review!
msg7233 (view) Author: Jez Ng (int3) Date: 2012-06-16.09:01:02
Patch updated based on feedback.
msg7264 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-06-27.18:33:47
This patch is applied, closing. Thanks Jez Ng!
History
Date User Action Args
2012-06-27 18:33:47fwierzbickisetstatus: open -> closed
priority: normal
resolution: fixed
messages: + msg7264
2012-06-16 09:01:02int3setfiles: + methodcaller
messages: + msg7233
2012-06-16 03:48:07int3setmessages: + msg7231
2012-06-15 21:41:32fwierzbickisetmessages: + msg7230
2012-06-15 18:38:58pjenveysetmessages: + msg7229
2012-06-15 18:36:30pjenveysetnosy: + pjenvey
messages: + msg7228
2012-06-15 17:09:46fwierzbickisetmessages: + msg7226
2012-06-15 17:06:48fwierzbickisetassignee: fwierzbicki
messages: + msg7225
nosy: + fwierzbicki
2012-06-15 12:07:33int3create