Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!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.033 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'indeed,': 0.09; 'valueerror:': 0.09; 'will,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '54,': 0.16; 'address)': 0.16; 'subject:Sort': 0.16; 'subject:dictionaries': 0.16; 'tempfile': 0.16; 'component': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'module': 0.19; 'file,': 0.19; '>>>': 0.22; 'example': 0.22; 'rules': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'skip:" 40': 0.26; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'chris': 0.29; 'am,': 0.29; 'especially': 0.30; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'asked': 0.31; 'easier': 0.31; '"",': 0.31; 'yesterday': 0.31; 'file': 0.32; 'another': 0.32; '(most': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'addresses,': 0.36; 'module.': 0.36; 'doing': 0.36; 'recent': 0.39; 'expect': 0.39; 'does': 0.39; 'sure': 0.39; 'how': 0.40; 'is.': 0.60; 'worry': 0.60; 'numbers': 0.61; 'address': 0.63; 'temporary': 0.65; 'mar': 0.68; 'overcome': 0.74; 'guaranteed': 0.75; '2015': 0.84; 'mistaken': 0.84; 'colleague': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=F3Wfmg5mmMJvmzd+vZ25IU5g2C19MpIeVGJ0MwZOA1c=; b=Hxzc4ieGKmSlahI0l2ipNClQzEFcSnWIeaqI8+LrEB+gC7Q+NRG6D2CScaqPuN6P3f 5LaYzb3MTFf27Y3ypr2wHiVq+1ASh5jTNPsvoePz9EHCwfXpmtM7yh66hogx0PCTs8tF Ny+eIFoxKTWCsLGfb3//sExSoKD1S5R2BIwqRpPT/cKIfG2dNZjtrODqVM4vssFHVL6c 1+s24k12E6eCvmqQLZXCbxgw4CRBmHFeJCaE9JX/yLMXRgl25l4Jiz4It7emOaR5uoti 2YZl8AA1ObRpzr4e4EOWvXrr5o46KzqqCKzI6ZRiwtVeQBLy9kdE5m9OEq9w7vw4wm6a wnGg== MIME-Version: 1.0 X-Received: by 10.194.171.136 with SMTP id au8mr71303741wjc.6.1425393920926; Tue, 03 Mar 2015 06:45:20 -0800 (PST) In-Reply-To: References: <946797be-10e6-433b-9411-2db0d5697ac8@googlegroups.com> Date: Tue, 3 Mar 2015 07:45:20 -0700 Subject: Re: Sort list of dictionaries From: Jason Friedman Cc: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1425393922 news.xs4all.nl 2852 [2001:888:2000:d::a6]:48196 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86846 On Tue, Mar 3, 2015 at 12:07 AM, Chris Angelico wrote: > Heh, I think that miiiiiiiight be a bit abusive :) I'm not sure that > you want to depend on the version numbers fitting inside the rules for > IP addresses, especially given that the example has a component of > "2214". > Indeed, I was mistaken >>> ipaddress.ip_address("1000.1.2.3") Traceback (most recent call last): File "", line 1, in File "/opt/python/lib/python3.4/ipaddress.py", line 54, in ip_address address) ValueError: '1000.1.2.3' does not appear to be an IPv4 or IPv6 address I was overcome by how neat I think the ipaddress module is. I have not used it yet, but I expect someday I will, and I appreciate how Python makes my job easier by doing much of my work for me. A colleague yesterday asked how I guaranteed my temporary file names would not collide with another file, and my answer was I don't have to worry about it, someone else figured it out with the tempfile module.