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 zach.ware
Recipients Antony.Lee, josh.r, pitrou, rhettinger, serhiy.storchaka, zach.ware
Date 2014年12月12日.06:36:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418366169.5.0.39187198415.issue22955@psf.upfronthosting.co.za>
In-reply-to
Content
Serhiy: functools.partial is a somewhat less than ideal comparison. The pure-Python version is not picklable, the Python and C versions return different things (the Python version is a function returning a function, the C version is a regular class and returns an instance). Also, both versions make their necessary attributes public anyway, unlike methodcaller.
Raymond: Not necessarily the usual approach, no. However, I think my reimplementations of the pure-Python itemgetter and attrgetter have a few benefits, namely:
- they're somewhat less complex and thus a bit easier to understand
- they're slightly faster
- they don't require extra pickling methods, which to me just seem like clutter when it's so simple to not need them
Note that I have no intention of reimplementing the C versions: those are much more mature than the Python versions, and would likely require pickling methods anyway.
All that said, I'm not going to fight about it; if I'm overruled, I'm overruled.
Josh: Serhiy's points about needing more tests stand; would you like to add them? You can use your patch or mine as a base, depending on how you feel about reimplementing the pure-Python (item|attr}getter. If you use yours, please remember to look through my comments on it.
History
Date User Action Args
2014年12月12日 06:36:09zach.waresetrecipients: + zach.ware, rhettinger, pitrou, serhiy.storchaka, Antony.Lee, josh.r
2014年12月12日 06:36:09zach.waresetmessageid: <1418366169.5.0.39187198415.issue22955@psf.upfronthosting.co.za>
2014年12月12日 06:36:09zach.warelinkissue22955 messages
2014年12月12日 06:36:08zach.warecreate

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