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


Groups > comp.lang.python > #25965

Re: What's wrong with this code?

References <mailman.2478.1343055006.4697.python-list@python.org> <sh02e9-iqk.ln1@satorlaser.homedns.org>
Date 2012-07-24 18:24 +1000
Subject Re: What's wrong with this code?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2523.1343118300.4697.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Jul 24, 2012 at 5:47 PM, Ulrich Eckhardt
<ulrich.eckhardt@dominolaser.com> wrote:
> There is one model that has helped me much understanding how Python ticks
> and that is the model of name tags. The code "a = 1" creates an integer with
> value 1 and attaches a tag with "a" written on it using a small piece of
> rope.

A double strand of rope, I think. If it were one strand, we'd write "a - 1". :)

> [0] Note that in almost all cases, when referring to a tag, Python
> implicitly operates on the object attached to it. One case (the only one?)
> where it doesn't is the "del" statement.

I'd say that del is more closely related to assignment than anything
else. You can go "a = None" to mark that a now points to nothing, or
you can "del a" to de-rope a altogether.

ChrisA

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


Thread

What's wrong with this code? Stone Li <viewfromoffice@gmail.com> - 2012-07-23 22:50 +0800
  Re: What's wrong with this code? Andrew Cooper <amc96@cam.ac.uk> - 2012-07-24 02:19 +0100
    Re: What's wrong with this code? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-07-24 07:23 +0100
    Re: What's wrong with this code? Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-07-24 03:38 -0400
    Re: What's wrong with this code? Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-24 02:26 -0600
  Re: What's wrong with this code? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-07-24 09:47 +0200
    Re: What's wrong with this code? Chris Angelico <rosuav@gmail.com> - 2012-07-24 18:24 +1000
      Re: What's wrong with this code? Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-07-24 12:05 +0200
    Re: What's wrong with this code? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-07-24 08:26 +0000
    Re: What's wrong with this code? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-07-24 11:34 +0200
  Re: What's wrong with this code? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-07-24 10:34 +0200

csiph-web