Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #70673
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'operand': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'comparison.': 0.16; 'determines': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'set()': 0.16; 'set,': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; 'result.': 0.19; '>>>': 0.22; 'manual': 0.22; 'header:User-Agent:1': 0.23; 'specifies': 0.24; 'compare': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'code': 0.31; '"",': 0.31; '3.x': 0.31; 'file': 0.32; '(most': 0.33; 'but': 0.35; 'there': 0.35; 'false': 0.36; 'to:addr :python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:173': 0.61; 'received:fios.verizon.net': 0.84; 'whereas': 0.91 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Terry Reedy <tjreedy@udel.edu> |
| Subject | Re: Inconsistent viewkeys behaviour |
| Date | Mon, 28 Apr 2014 06:28:48 -0400 |
| References | <CAN1F8qWEO6N6MOXpFUM0rNa9nNAjF79WOD+De9n1pFZpibDF-w@mail.gmail.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Gmane-NNTP-Posting-Host | pool-173-75-254-207.phlapa.fios.verizon.net |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
| In-Reply-To | <CAN1F8qWEO6N6MOXpFUM0rNa9nNAjF79WOD+De9n1pFZpibDF-w@mail.gmail.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.9546.1398680984.18130.python-list@python.org> (permalink) |
| Lines | 18 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1398680984 news.xs4all.nl 2939 [2001:888:2000:d::a6]:48886 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:70673 |
Show key headers only | View raw
On 4/28/2014 2:22 AM, Joshua Landau wrote: > Is there any reference for this strange behaviour on Python 2: > > >>> set() < dict().viewkeys() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > TypeError: can only compare to a set > >>> dict().viewkeys() > set() > False The left operand determines the result. The manual specifies that < and > do not have to be consistent. But I suspect that when 3.x dict.keys() was backported to 2.7.0, no one thought to update set, whereas the backported key view code already had the comparison. -- Terry Jan Reedy
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Inconsistent viewkeys behaviour Terry Reedy <tjreedy@udel.edu> - 2014-04-28 06:28 -0400 Re: Inconsistent viewkeys behaviour Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-04-29 12:08 +1200
csiph-web