Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86615

Re: Python Worst Practices

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.023
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:Python': 0.06; 'builtin': 0.09; 'dan': 0.09; 'objects,': 0.09; 'cc:addr:python- list': 0.11; 'dict': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'keys.': 0.16; 'once.': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; "i've": 0.25; 'references': 0.26; 'header :In-Reply-To:1': 0.27; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; 'fri,': 0.33; 'received:google.com': 0.35; 'pm,': 0.38; 'rather': 0.38; 'even': 0.60; 'ian': 0.60; 'hang': 0.67; '2015': 0.84; 'case?': 0.84; 'ever.': 0.84; 'subject:Practices': 0.84; '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=CL/92rgVt+kgndQF41ay9JTsQkWskAw19kAmUPs/mfg=; b=d5dYa8TE0fuqyNV7CA7KYNd2Y0SBlR6DgJ6wfAO6VQD880macsVCemDkDSucpw8VM6 QrmPA6FAliu8ugvvDD8gsaqQ0VPmwFt6bU7r9l+Hzs6tXdg5vzl0IIHMFlKKk/7MXyYf kdZiOv/aQBEoHTEm+ZYf8b1PBVHwgDSAj2g152JKizK2MgHOYwlAenoRS0J36ShRUzqO EqMaBmffgsQ2DAmTVmpgHm73xC1d1lP9GuqN9kR8Xt3Jhv2unt8tLstt4/PvawwAgTxF TpvKnU3V5l7LHXfFQEidqf6JG9bwXVj2NZfSilY6tUXySrESIJ48ISKJxuq1RJQipfKe AHKw==
MIME-Version 1.0
X-Received by 10.50.79.161 with SMTP id k1mr9702698igx.14.1425113905530; Sat, 28 Feb 2015 00:58:25 -0800 (PST)
In-Reply-To <CALwzidkKsRGk+JLnZGNu8-5JJudsxBqjSdwra6R3V4CV+ziMpQ@mail.gmail.com>
References <mclca6$iie$1@ger.gmane.org> <mailman.19318.1425072098.18130.python-list@python.org> <54f1154c$0$12985$c3e8da3$5496439d@news.astraweb.com> <mcrgvg$fjl$1@dont-email.me> <CALwzidkKsRGk+JLnZGNu8-5JJudsxBqjSdwra6R3V4CV+ziMpQ@mail.gmail.com>
Date Sat, 28 Feb 2015 19:58:25 +1100
Subject Re: Python Worst Practices
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.19332.1425113912.18130.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1425113912 news.xs4all.nl 2900 [2001:888:2000:d::a6]:47019
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:86615

Show key headers only | View raw


On Sat, Feb 28, 2015 at 7:48 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Fri, Feb 27, 2015 at 9:42 PM, Dan Sommers <dan@tombstonezero.net> wrote:
>> I don't think I've ever used the builtin function id in a program.
>> Ever.  Not even once.  Honestly, what is a valid use case?
>
> If you have a dict that you want to key on object identity rather than
> equality, then you can use object ids as the keys.

And not forget to hang onto references to all those objects, else
their ids will be meaningless.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Python Worst Practices Travis Griggs <travisgriggs@gmail.com> - 2015-02-27 13:21 -0800
  Re: Python Worst Practices Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-28 12:09 +1100
    Re: Python Worst Practices sohcahtoa82@gmail.com - 2015-02-27 17:32 -0800
      Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 12:44 +1100
        Re: Python Worst Practices Christian Gollwitzer <auriocus@gmx.de> - 2015-03-03 09:51 +0100
          Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-03-03 22:12 +1100
            Re: Python Worst Practices Christian Gollwitzer <auriocus@gmx.de> - 2015-03-03 23:46 +0100
              Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-03-04 10:12 +1100
                Re: Python Worst Practices Christian Gollwitzer <auriocus@gmx.de> - 2015-03-04 21:27 +0100
    Re: Python Worst Practices Dan Sommers <dan@tombstonezero.net> - 2015-02-28 04:42 +0000
      Re: Python Worst Practices Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-02-28 17:36 +1100
        Re: Python Worst Practices Dan Sommers <dan@tombstonezero.net> - 2015-02-28 07:50 +0000
          Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 19:55 +1100
        Re: Python Worst Practices Ethan Furman <ethan@stoneleaf.us> - 2015-02-27 23:51 -0800
          Re: Python Worst Practices Marko Rauhamaa <marko@pacujo.net> - 2015-02-28 10:50 +0200
      Re: Python Worst Practices Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-28 01:48 -0700
      Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 19:58 +1100
    Re: Python Worst Practices Tim Chase <python.list@tim.thechases.com> - 2015-02-27 21:50 -0600
      Re: Python Worst Practices Cousin Stanley <cousinstanley@gmail.com> - 2015-02-28 09:03 -0700
        Re: Python Worst Practices Rustom Mody <rustompmody@gmail.com> - 2015-02-28 08:16 -0800
        Re: Python Worst Practices MRAB <python@mrabarnett.plus.com> - 2015-02-28 17:56 +0000
        Re: Python Worst Practices Ethan Furman <ethan@stoneleaf.us> - 2015-02-28 10:13 -0800
        Re: Python Worst Practices Tim Chase <python.list@tim.thechases.com> - 2015-02-28 12:30 -0600
        Re: Python Worst Practices Tim Chase <python.list@tim.thechases.com> - 2015-02-28 12:39 -0600
    Re: Python Worst Practices BartC <bc@freeuk.com> - 2015-02-28 10:39 +0000
      Re: Python Worst Practices Chris Angelico <rosuav@gmail.com> - 2015-02-28 23:45 +1100
        Re: Python Worst Practices Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-03-01 13:29 +1300

csiph-web