Path: csiph.com!aioe.org!news.mixmin.net!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!feedme.news.telefonica.de!telefonica.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Marco Sulla Newsgroups: comp.lang.python Subject: Re: Suggestion: make sequence and map interfaces more similar Date: Sat, 26 Mar 2016 01:35:33 +0100 Lines: 17 Sender: elbarbun@gmail.com Message-ID: References: <56f27d76$0$1600$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de Kxpz2fC8/wyKW+nMJrrnaQUIdz6C4ki3ZIhFD151nGFg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'sequences.': 0.07; 'cc:addr:python-list': 0.09; 'cc:name:python': 0.16; 'iterable': 0.16; 'parameter,': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:interfaces': 0.16; 'subject:make': 0.16; 'useless': 0.16; 'wrote:': 0.16; 'sender:addr:gmail.com': 0.18; '>': 0.18; 'input': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'parameter': 0.22; 'suppose': 0.22; 'ease': 0.23; 'implemented': 0.24; 'header:In- Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'sequence': 0.27; 'interface': 0.29; 'code': 0.30; "i'd": 0.31; "can't": 0.32; 'noticed': 0.32; 'common': 0.33; 'add': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'generic': 0.35; 'but': 0.36; 'too': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'seem': 0.37; 'creation': 0.38; 'late': 0.38; 'received:209': 0.38; 'does': 0.39; 'subject:more': 0.61; 'introduce': 0.79; 'otten': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:cc; bh=Ooyj6qBlCulmbFdOx7W6wfZdAMhZfXDBRp5OBFnieCE=; b=d590tiofq7b6ZK4ZqLHsTJc9qm5aFEy/6plCEXdny9Mtyut74NAYzbiFs82Ql0+E31 6igWFCZdqD+nzEecT9jm1+Gf0SylauBilbeL3a9QAk4YytM/3l8Tcd03d5sKQgdA3AY8 EEoEB8SeEseY/h4IBAE8U/6hupUjTDt1CiyNdTd0uP6+nosLQKNKW3Tcx9VzprBGUsnR UzFezNU7Nwco1ZY3v9ZaGX85/iqIsAk8audaZY+0wKQ+Q/FW9B0GOeSiFxngcaKrneyF A2PFlQ94yGhky7Ifkl/aexvEz/tlgHvrY5CELVbbN1Wy+q3FJZwbiPxbVwpxNl4QmBRN +diw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:cc; bh=Ooyj6qBlCulmbFdOx7W6wfZdAMhZfXDBRp5OBFnieCE=; b=W3EEvtSUsfl89Aqi+LNN+GVxdnu0qpynylISSbZqjTJ3dwR9qQwOVJyLK1ZXFpBMHe g6baaShHXDMj9vaYAP6mdJQprs6K9KweGXSYS0uFOfqDU7BHB0QFTrVQS2Henjqz5+b9 M5npZOnk4hJp7dYABBL5Tam/ujiioY9rqYYZskP/n7gi9710g3bacpbcBKWRe25t9lAG 56vQ6I3ZOk2Iiabs9lojSGuOhYF7IirYgt0wEuXx89pTyI1R5STJ/7eap0iIQvSnF2CJ goI1XSQg4DC33ZholuSCx4Ww8s6MfUK6X/FavwI5AzX1ddE2ND4AQKUCfH0l2YTsd9zJ b9KQ== X-Gm-Message-State: AD7BkJIVfVLdAicl47JuQPH0kUnFKU+L+R8yS/yFP4Rway9NwnF+j9MGgW4hXYDY2J15jOmp9p5BljYja2pWpg== X-Received: by 10.50.28.72 with SMTP id z8mr1017391igg.44.1458952572422; Fri, 25 Mar 2016 17:36:12 -0700 (PDT) In-Reply-To: <56f27d76$0$1600$c3e8da3$5496439d@news.astraweb.com> X-Google-Sender-Auth: AcA6cGEEqeOV9sfdt1GnyQYjTBg X-Mailman-Approved-At: Sat, 26 Mar 2016 05:59:33 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105735 Peter Otten wrote: >> I noticed that the sequence types does not have these methods that the map >> types has: get(), items(), keys(), values(). >> It could seem useless to have them for sequences, but I think it will ease >> the creation of functions and methods that allow you to input a generic >> iterable as parameter, but needs to use one of these methods in case the >> parameter is a map. > It will also break existing uses of duck typing. Yes, I suppose it's too late to introduce these methods to sequences. I'd like to see vdict implemented anyway. It can't break old code and add a map type that has a common interface with sequences.