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


Groups > comp.lang.python > #43808

Re: Atoms, Identifiers, and Primaries

Newsgroups comp.lang.python
Date 2013-04-17 21:29 -0700
References <66e78281-542b-41b3-a56d-04bf736d1e0a@googlegroups.com> <mailman.709.1366183663.3114.python-list@python.org>
Subject Re: Atoms, Identifiers, and Primaries
From 88888 Dihedral <dihedral88888@googlemail.com>
Message-ID <mailman.755.1366259407.3114.python-list@python.org> (permalink)

Show all headers | View raw


Ian於 2013年4月17日星期三UTC+8下午3時21分00秒寫道:
> On Tue, Apr 16, 2013 at 8:57 PM, Bruce McGoveran
> 
>  wrote:
> 
> > These are terms that appear in section 5 (Expressions) of the Python online documentation.  I'm having some trouble understanding what, precisely, these terms mean.  I'd appreciate the forum's thoughts on these questions:
> 
> >
> 
> > 1.  Section 5.2.1 indicates that an identifier occurring as an atom is a name.  However, Section 2.3 indicates that identifiers are names.  My question:  can an identifier be anything other than a name?
> 
> 
> 
> Yes.  For example:
> 
> 
> 
> from a import b
> 
> 
> 
> Here "a" is an identifier but not a name, as it does not carry
> 
> object-binding semantics.
> 
> 
> 
> > 2.  Section 5.3 defines primaries as the most tightly bound operations of Python.  What does this mean?
> 
> 
> 
> "Tightly bound" here refers to operator precedence.  For example, we
> 
> say that the multiplication operator binds more tightly [to the
> 
> surrounding operands] than the arithmetic operator, because the
> 
> multiplication takes precedence.  This section defines that the most
> 
> tightly bound operations in Python are attribute references,
> 
> subscriptions, slices and calls; these always take precedence over
> 
> other neighboring operations.
> 
> 
> 
> > In particular, if an atom is a primary, what operation is the atom performing that leads to the label "most tightly bound"?
> 
> 
> 
> An atom doesn't perform an operation.  The grammar defines that a
> 
> primary can be just an atom, so that anywhere in the grammar that
> 
> expects a primary, a simple atom with no primary operation performed
> 
> on it can equally be used.

An atom can not be divided into further details.
An atom can be created and cloned or just referenced 
in some relations.

An object is composed of atoms linked in someway.

Of course, one can box those atoms of an object 
to make the object immutable at least in some situations
to be named and used.

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


Thread

Atoms, Identifiers, and Primaries Bruce McGoveran <bruce.mcgoveran@gmail.com> - 2013-04-16 19:57 -0700
  Re: Atoms, Identifiers, and Primaries rusi <rustompmody@gmail.com> - 2013-04-16 20:55 -0700
    Re: Atoms, Identifiers, and Primaries Mark Janssen <dreamingforward@gmail.com> - 2013-04-17 16:40 -0700
      Re: Atoms, Identifiers, and Primaries alex23 <wuwei23@gmail.com> - 2013-04-17 17:29 -0700
        Re: Atoms, Identifiers, and Primaries Mark Janssen <dreamingforward@gmail.com> - 2013-04-17 17:41 -0700
        Re: Atoms, Identifiers, and Primaries Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-18 02:04 +0100
      Re: Atoms, Identifiers, and Primaries rusi <rustompmody@gmail.com> - 2013-04-18 00:40 -0700
    Re: Atoms, Identifiers, and Primaries Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-17 18:33 -0600
      Re: Atoms, Identifiers, and Primaries Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-18 02:14 +0000
        Re: Atoms, Identifiers, and Primaries Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-17 21:12 -0600
    Re: Atoms, Identifiers, and Primaries Mark Janssen <dreamingforward@gmail.com> - 2013-04-17 18:04 -0700
    Re: Atoms, Identifiers, and Primaries Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-04-18 02:08 +0100
    Re: Atoms, Identifiers, and Primaries Chris Angelico <rosuav@gmail.com> - 2013-04-18 11:56 +1000
    Re: Atoms, Identifiers, and Primaries Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-17 21:10 -0600
  Re: Atoms, Identifiers, and Primaries Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-17 01:21 -0600
    Re: Atoms, Identifiers, and Primaries 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-17 21:29 -0700
    Re: Atoms, Identifiers, and Primaries 88888 Dihedral <dihedral88888@googlemail.com> - 2013-04-17 21:29 -0700
  Re: Atoms, Identifiers, and Primaries Dave Angel <davea@davea.name> - 2013-04-17 07:07 -0400
  Re: Atoms, Identifiers, and Primaries Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-17 11:43 +0000
  Re: Atoms, Identifiers, and Primaries Bruce McGoveran <bruce.mcgoveran@gmail.com> - 2013-04-17 10:15 -0700
    Re: Atoms, Identifiers, and Primaries Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-18 04:43 +1000
      Re: Atoms, Identifiers, and Primaries rusi <rustompmody@gmail.com> - 2013-04-18 10:04 -0700

csiph-web