[issue4615] de-duping function in itertools

2009-01-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: Added recipes to the itertools docs: r68177 . -- resolution: -> accepted status: open -> closed ___ Python tracker ___ _

[issue4615] de-duping function in itertools

2008-12-18 Thread David W. Lambert
David W. Lambert added the comment: (but of course with imap in version 2.7 and with something else in version 3.x) -- nosy: +LambertDW ___ Python tracker ___ ___

[issue4615] de-duping function in itertools

2008-12-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: My inclination is to not include this as a basic C coded itertool because it holds potentially all of the data in memory (generally, not a characteristic of an itertool) and because I don't see it as a basic building block (itertools are intended to be elemen

[issue4615] de-duping function in itertools

2008-12-09 Thread Tom Pinckney
Tom Pinckney <[EMAIL PROTECTED]> added the comment: My latest need for something like this was something like this: src1 = db_query(query_1) src2 = db_query(query_2) results = deduped(src1 + src2, key=lambda x: x.field2) Basically, I wanted data from src1 if it existed and otherwise from src2

[issue4615] de-duping function in itertools

2008-12-09 Thread Raymond Hettinger
Raymond Hettinger <[EMAIL PROTECTED]> added the comment: Am curious about your use cases. In what contexts are you needing to eliminate duplicates but retain the original ordering? Am wondering if the proposals for an ordered dictionary will meet your needs? Also, am looking to see what typifi

[issue4615] de-duping function in itertools

2008-12-09 Thread Benjamin Peterson
Changes by Benjamin Peterson <[EMAIL PROTECTED]>: -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue4615] de-duping function in itertools

2008-12-09 Thread Tom Pinckney
New submission from Tom Pinckney <[EMAIL PROTECTED]>: Any interest in an itertools de-duping function? I find I have to write this over and over for different projects: def deduped(iter,key=None): keys = set() for x in iter: if key: k = key(x) else: