Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'subject:Python': 0.06; '2.3,': 0.09; 'subject:language': 0.09; 'python': 0.11; 'def': 0.12; '**kwargs)': 0.16; '**kwargs):': 0.16; 'constructor.': 0.16; 'sense,': 0.16; 'set()': 0.16; 'subject: \n ': 0.16; 'subject:?)': 0.16; 'subject:unicode': 0.16; 'wrote:': 0.18; 'library': 0.18; 'thu,': 0.19; 'module,': 0.24; 'initial': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'forgot': 0.30; 'important.': 0.30; 'sets': 0.30; 'message- id:@mail.gmail.com': 0.30; '25,': 0.31; "d'aprano": 0.31; 'sets.': 0.31; 'steven': 0.31; 'skip:_ 10': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'set.': 0.36; "didn't": 0.36; 'method': 0.36; 'starting': 0.37; 'implement': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'even': 0.60; 'ian': 0.60; 'challenge': 0.61; 'first': 0.61; 'real': 0.63; 'more': 0.64; 'mar': 0.68; 'subject:this': 0.83; 'everywhere.': 0.84; 'hand,': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=BWVRITp3JWbuJTXr0sCq4KaF/ucwoMlfmWwvJLSb2YE=; b=zKQ0YOEpzBJuYE93vCGJk4v4zr7DcA2xXBcHkinYkb1CjSL7bmCWoKKXweF1/cPKcJ K3TK+8JnviDABafItXWsp9OvZNjb4BqjmooQLQVleciNfNVad8zXMakfUEUSRtmsnduT tHWYwE0vYt+UwvIvaOen27voXKmtDi8LkBn8/klrJbKpwAZZXt6KEJzCLI+LVfcq9pM0 EqbhXrZjtXzicURLJCd4OD7NFEqq0mjN5LxYtqiyr3mWMFcx/spi2jlN3kSCawqQU+6Z HstpqSrOI/3Hmid49B2Asy2lwfHg14lxCAkjWq+7xl2yhcvoF61gba2Dh3WXBzBtJOPc hXHg== X-Received: by 10.66.5.135 with SMTP id s7mr274759pas.154.1395906261691; Thu, 27 Mar 2014 00:44:21 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <9daf0806-02de-4447-964c-c8f8953c23e5@googlegroups.com> <532d5bd9$0$29994$c3e8da3$5496439d@news.astraweb.com> <0b78649a-16b3-4410-8258-e859578d62be@googlegroups.com> <53060a97-44fb-4e53-a7a7-d5eeed416f62@googlegroups.com> <53318664$0$29994$c3e8da3$5496439d@news.astraweb.com> From: Ian Kelly Date: Thu, 27 Mar 2014 01:43:41 -0600 Subject: Re: Time we switched to unicode? (was Explanation of this Python language feature?) To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395906265 news.xs4all.nl 2953 [2001:888:2000:d::a6]:51961 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69175 On Thu, Mar 27, 2014 at 1:32 AM, Ian Kelly wrote: > On Tue, Mar 25, 2014 at 7:36 AM, Steven D'Aprano > wrote: >> Yes, Python could have changed the meaning of {} to mean the empty set. >> But you know what? The empty set is not that important. Sets are not >> fundamental to Python. Python didn't even have sets until 2.3, and at >> first they were just a standard library module, not even built-in. Dicts, >> on the other hand, are fundamental to Python. They are used everywhere. >> Python is, in a very real sense, built on dicts, not sets. You can >> implement sets starting from dicts, but not the other way around: dicts >> are more fundamental than sets. > > Challenge accepted! Oops, I forgot to allow for a 0-argument constructor. Please revise the SetBasedDict.__init__ method to: def __init__(self, initial=(), **kwargs): self._contents = set() if initial or kwargs: self.update(initial, **kwargs)