Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36215
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <d@davea.name> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.015 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'default.': 0.07; 'interpreted': 0.07; 'subject:test': 0.07; 'compute': 0.09; 'subtract': 0.09; 'terry': 0.09; 'will,': 0.09; 'suggest': 0.11; 'reedy': 0.16; 'subject:expression': 0.16; 'wrote:': 0.17; 'trying': 0.21; 'thanks.': 0.21; 'sets': 0.23; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'supported': 0.26; 'comparison': 0.29; 'loop,': 0.29; 'sense': 0.31; 'lists': 0.31; 'point': 0.31; 'ordered': 0.33; 'to:addr:python-list': 0.33; 'false': 0.35; 'faster': 0.35; 'pm,': 0.35; 'something': 0.35; "wasn't": 0.36; 'turn': 0.36; 'does': 0.37; 'item': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'perfect': 0.63; 'header:Reply-To:1': 0.68; 'soon': 0.70; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'sets,': 0.84; 'angel': 0.93 |
| Date | Sat, 05 Jan 2013 17:05:20 -0500 |
| From | Dave Angel <d@davea.name> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: reduce expression to test sublist |
| References | <76cd3945-392e-40d4-9f87-d3956b9521d2@googlegroups.com> <50E877C2.8090208@davea.name> <kca7i0$e9g$1@ger.gmane.org> |
| In-Reply-To | <kca7i0$e9g$1@ger.gmane.org> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 7bit |
| X-Provags-ID | V02:K0:IPMqOJTcYFSGnEjspR0gpk3rh7CrpSniUKDTyIoGdvt JzlOPk7Jou+GnjeyYHhYl1MucB1QiJeYSi5dD5nUucWi0Ua4u9 FcTf5sX9arHbwNx03No+j9lCJRBWkr7sUWbltDTHOn4xSuiTEM RL61k7c+tqeoONuoIsr4iKIh12aGGrSIiwpICUZktgagRsrlW0 ywew0bLJiK7AhOjCsP4C8+25QiKm5jgZW59KcC3QGWBxiq5ESA dUvj3MLwwLHxl6EFjnjitOcZSLJcIao04lbghCp4mVrwCTLypX 9QLyQ2ekDyxL5dF2dccKz2Yp3mRUcwGUX5/Uf8BAsD/cEbLdg= = |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | d@davea.name |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.149.1357423542.2939.python-list@python.org> (permalink) |
| Lines | 27 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1357423542 news.xs4all.nl 6857 [2001:888:2000:d::a6]:56164 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:36215 |
Show key headers only | View raw
On 01/05/2013 04:55 PM, Terry Reedy wrote: > On 1/5/2013 1:58 PM, Dave Angel wrote: > >> If you're trying to make a faster loop, then I suggest you look into set >> differences. Turn both lists into sets, and subtract them. Something >> like (untested): >> >> result = not bool( set(lst1) - set(lst2) ) > > This does not return False as soon as an item in set1 is found that is > not in set2. > > set(lst1) < set(lst2) > > will, and directly return False/True. The OP is trying to compute the > lst1 < lst2, where lst1 and lst2 are interpreted as sets, rather than > as sequences with the lexicographic ordering default. > Thanks. I wasn't aware that sets supported ordered comparison that way, though it makes perfect sense now that you point it out. -- DaveA
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
reduce expression to test sublist Asim <asim.r.p@gmail.com> - 2013-01-05 10:25 -0800 Re: reduce expression to test sublist Dave Angel <d@davea.name> - 2013-01-05 13:58 -0500 Re: reduce expression to test sublist chaouche yacine <yacinechaouche@yahoo.com> - 2013-01-05 11:59 -0800 Re: reduce expression to test sublist Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-01-05 22:41 +0200 Re: reduce expression to test sublist Terry Reedy <tjreedy@udel.edu> - 2013-01-05 16:55 -0500 Re: reduce expression to test sublist Terry Reedy <tjreedy@udel.edu> - 2013-01-05 16:55 -0500 Re: reduce expression to test sublist Dave Angel <d@davea.name> - 2013-01-05 17:05 -0500
csiph-web