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


Groups > comp.lang.python > #96368 > unrolled thread

Re: Python handles globals badly.

Started bytdev@freenet.de
First post2015-09-11 14:26 -0700
Last post2015-09-12 00:03 +0100
Articles 13 on this page of 133 — 20 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python handles globals badly. tdev@freenet.de - 2015-09-11 14:26 -0700
    Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-11 23:50 +0200
      Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2015-09-11 18:01 -0600
        Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-12 07:22 +0200
          Re: Python handles globals badly. MRAB <python@mrabarnett.plus.com> - 2015-09-12 18:05 +0100
            Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-13 14:04 +0200
              Re: Python handles globals badly. Steven D'Aprano <steve@pearwood.info> - 2015-09-13 22:06 +1000
                Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-13 14:11 +0200
                  Re: Python handles globals badly. Ned Batchelder <ned@nedbatchelder.com> - 2015-09-13 05:17 -0700
                    Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-15 05:36 +0200
          Re: Python handles globals badly. Emile van Sebille <emile@fenx.com> - 2015-09-12 10:18 -0700
            Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-13 14:06 +0200
              Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-13 14:10 +0200
          Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2015-09-12 20:32 -0600
            Re: Python handles globals badly. "Skybuck Flying" <skybuck2000@hotmail.com> - 2015-09-13 14:05 +0200
      Re: Python handles globals badly. random832@fastmail.us - 2015-09-11 20:11 -0400
      Re: Python handles globals badly. Michael Torrie <torriem@gmail.com> - 2015-09-11 18:34 -0600
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 03:57 +0100
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 04:01 +0100
      Re: Python handles globals badly. Random832 <random832@fastmail.com> - 2015-09-12 00:06 -0400
      Re: Python handles globals badly. Random832 <random832@fastmail.com> - 2015-09-12 00:16 -0400
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 05:17 +0100
      Terminology: “reference” versus “pointer” (was: Python handles globals badly.) Ben Finney <ben+python@benfinney.id.au> - 2015-09-12 14:27 +1000
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 05:34 +0100
      Re: Python handles globals badly. Random832 <random832@fastmail.com> - 2015-09-12 00:34 -0400
      Re: Terminology: “reference” versus “pointer” Random832 <random832@fastmail.com> - 2015-09-12 00:42 -0400
        Re: Terminology: “reference” versus “pointer” Steven D'Aprano <steve@pearwood.info> - 2015-09-13 02:32 +1000
          Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 09:54 -0700
            Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-13 03:06 +1000
            Re: Terminology: "reference" versus "pointer" Emile van Sebille <emile@fenx.com> - 2015-09-12 10:14 -0700
            Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 03:24 +1000
              Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-13 03:34 +1000
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 05:45 +0100
      Re: Terminology: “reference” versus “pointer” Ben Finney <ben+python@benfinney.id.au> - 2015-09-12 14:52 +1000
      Re: Terminology: “reference” versus “pointer” Random832 <random832@fastmail.com> - 2015-09-12 01:03 -0400
        Re: Terminology: “reference” versus “pointer” Steven D'Aprano <steve@pearwood.info> - 2015-09-13 02:50 +1000
          Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 10:04 -0700
      Re: Python handles globals badly. Random832 <random832@fastmail.com> - 2015-09-12 01:07 -0400
      Re: Terminology: “reference” versus “pointer” Ben Finney <ben+python@benfinney.id.au> - 2015-09-12 15:20 +1000
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 06:25 +0100
      Re: Python handles globals badly. Random832 <random832@fastmail.com> - 2015-09-12 01:35 -0400
      Re: Terminology: “reference” versus “pointer” Random832 <random832@fastmail.com> - 2015-09-12 01:42 -0400
      Re: Python handles globals badly. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 06:54 +0100
      Re: Terminology: “reference” versus “pointer” Chris Angelico <rosuav@gmail.com> - 2015-09-12 16:02 +1000
      Re: Terminology: “reference” versus “pointer” Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-12 07:05 +0100
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-12 16:13 +1000
      Re: Terminology: “reference” versus “pointer” Random832 <random832@fastmail.com> - 2015-09-12 02:15 -0400
      Re: Python handles globals badly. Random832 <random832@fastmail.com> - 2015-09-12 02:25 -0400
      Re: Terminology: “reference” versus “pointer” Ben Finney <ben+python@benfinney.id.au> - 2015-09-12 16:26 +1000
        Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 05:46 -0700
          Re: Terminology: "reference" versus "pointer" Laura Creighton <lac@openend.se> - 2015-09-12 16:41 +0200
            Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 08:13 -0700
              Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 09:17 -0700
                Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 10:12 -0700
                  Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 04:14 +1000
                Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 03:48 +1000
                  Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 11:45 -0700
                    Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 22:50 +1000
                      Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 23:29 +1000
                      Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-13 18:34 -0700
                        Re: Terminology: "reference" versus "pointer" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-14 04:34 +0100
                  Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 12:58 -0700
                    Re: Terminology: "reference" versus "pointer" Emile van Sebille <emile@fenx.com> - 2015-09-12 15:14 -0700
                      Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 15:34 -0700
                        Re: Terminology: "reference" versus "pointer" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-13 00:14 +0100
                          Re: Terminology: "reference" versus "pointer" Ned Batchelder <ned@nedbatchelder.com> - 2015-09-12 17:02 -0700
                            Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 17:28 -0700
                            Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 17:44 -0700
                              Re: Terminology: "reference" versus "pointer" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-13 03:22 +0100
                                Re: Terminology: "reference" versus "pointer" Ned Batchelder <ned@nedbatchelder.com> - 2015-09-12 19:25 -0700
                              Re: Terminology: "reference" versus "pointer" Michael Torrie <torriem@gmail.com> - 2015-09-12 20:35 -0600
                              Re: Terminology: "reference" versus "pointer" Ben Finney <ben+python@benfinney.id.au> - 2015-09-13 12:42 +1000
                                Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-13 08:31 -0700
                                  Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-14 01:39 +1000
                                  Re: Terminology: "reference" versus "pointer" Ben Finney <ben+python@benfinney.id.au> - 2015-09-14 06:48 +1000
                                    Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-13 18:13 -0700
                              Re: Terminology: "reference" versus "pointer" Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-09-13 12:32 -0400
                          Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 17:23 -0700
                        Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 16:39 -0700
                          Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-13 10:19 +1000
                          Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 17:25 -0700
                            Re: Terminology: "reference" versus "pointer" rurpy@yahoo.com - 2015-09-12 18:07 -0700
              Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-12 20:54 +0300
                Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 11:21 -0700
                  Re: Terminology: "reference" versus "pointer" Jussi Piitulainen <harvesting@makes.email.invalid> - 2015-09-12 23:02 +0300
                    Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-12 17:10 -0400
                      Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 12:30 +1000
                      Re: Terminology: "reference" versus "pointer" Jussi Piitulainen <harvesting@makes.email.invalid> - 2015-09-13 09:40 +0300
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-12 23:13 +0300
                  Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-12 17:27 -0400
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-13 21:04 +0300
                  Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-14 05:03 +1000
                  Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-13 15:04 -0400
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 02:17 +0300
                    Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-14 11:10 +1000
                      Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 04:22 +0300
                        Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-14 12:38 +1000
                          Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 06:23 +0300
                            Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-15 02:59 +1000
                              Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 20:24 +0300
                                Re: Terminology: "reference" versus "pointer" Ned Batchelder <ned@nedbatchelder.com> - 2015-09-14 11:29 -0700
                                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 22:30 +0300
                                    Re: Terminology: "reference" versus "pointer" Ned Batchelder <ned@nedbatchelder.com> - 2015-09-14 13:16 -0700
                                      Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 23:32 +0300
                      Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-14 11:30 +1000
                      Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 05:26 +0300
                  Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-14 09:52 +1000
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 03:30 +0300
                  Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-14 10:58 +1000
                  Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-13 19:38 -0400
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 17:48 +0300
                  Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-14 11:10 -0400
                    Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-15 03:03 +1000
                      Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-14 13:34 -0400
                        Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-16 00:26 +1000
                      Re: Terminology: "reference" versus "pointer" Emile van Sebille <emile@fenx.com> - 2015-09-14 10:51 -0700
                        Re: Terminology: "reference" versus "pointer" Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-09-16 20:14 +1200
                          Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-16 18:18 +1000
                          Re: Terminology: "reference" versus "pointer" Ben Finney <ben+python@benfinney.id.au> - 2015-09-16 18:24 +1000
                          Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-16 18:33 +1000
                      Re: Terminology: "reference" versus "pointer" Chris Angelico <rosuav@gmail.com> - 2015-09-15 03:59 +1000
                      Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-14 14:02 -0400
                        Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-16 00:14 +1000
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 20:45 +0300
                  Re: Terminology: "reference" versus "pointer" Random832 <random832@fastmail.com> - 2015-09-14 14:00 -0400
                  Re: Terminology: "reference" versus "pointer" Akira Li <4kir4.1i@gmail.com> - 2015-09-14 21:17 +0300
          Re: Terminology: "reference" versus "pointer" Steven D'Aprano <steve@pearwood.info> - 2015-09-13 03:08 +1000
            Re: Terminology: "reference" versus "pointer" Rustom Mody <rustompmody@gmail.com> - 2015-09-12 10:26 -0700
          Re: Terminology: "reference" versus "pointer" Ben Finney <ben+python@benfinney.id.au> - 2015-09-13 11:13 +1000
      Re: Python handles globals badly. Chris Angelico <rosuav@gmail.com> - 2015-09-12 16:27 +1000
      Re: Terminology: “reference” versus “pointer” Chris Angelico <rosuav@gmail.com> - 2015-09-12 16:31 +1000
    Re: Python handles globals badly. Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-11 16:10 -0600
    Re: Python handles globals badly. MRAB <python@mrabarnett.plus.com> - 2015-09-12 00:03 +0100

Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]


#96582 — Re: Terminology: "reference" versus "pointer"

FromChris Angelico <rosuav@gmail.com>
Date2015-09-15 03:59 +1000
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<mailman.545.1442253552.8327.python-list@python.org>
In reply to#96576
On Tue, Sep 15, 2015 at 3:51 AM, Emile van Sebille <emile@fenx.com> wrote:
> Actually, boxes with integers in them isn't the appropriate analogy.
> Consider the naming of cats.  My cat is known to me as Paddy.  My next door
> neighbor sometimes feeds her and is known to her as Stripes.  The cat also
> is known as kitty to my youngest daughter.  The cat has no idea what its
> name is, it just is and eats.

Thanks for that. As someone who shares a house with a cat (not my
own), I find this apt and amusing. :)

ChrisA

[toc] | [prev] | [next] | [standalone]


#96584 — Re: Terminology: "reference" versus "pointer"

FromRandom832 <random832@fastmail.com>
Date2015-09-14 14:02 -0400
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<mailman.547.1442253722.8327.python-list@python.org>
In reply to#96576

On Mon, Sep 14, 2015, at 13:51, Emile van Sebille wrote:
> Actually, boxes with integers in them isn't the appropriate analogy. 
> Consider the naming of cats.  My cat is known to me as Paddy.  My next 
> door neighbor sometimes feeds her and is known to her as Stripes.  The 
> cat also is known as kitty to my youngest daughter.  The cat has no idea 
> what its name is, it just is and eats.  So three labels, one object. 
> Putting the object in three boxes isn't right

The point is that with immutable objects no-one cares if they are three
objects with the same value, or three references to the same object.
Your cat is not an integer.

[toc] | [prev] | [next] | [standalone]


#96636 — Re: Terminology: "reference" versus "pointer"

FromSteven D'Aprano <steve@pearwood.info>
Date2015-09-16 00:14 +1000
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<55f827bb$0$1671$c3e8da3$5496439d@news.astraweb.com>
In reply to#96584
On Tue, 15 Sep 2015 04:02 am, Random832 wrote:

> The point is that with immutable objects no-one cares if they are three
> objects with the same value, or three references to the same object.

Well, you might care...

a = (1,)*(10**12)
b = (1,)*(10**12)
c = (1,)*(10**12)


Each of those tuples would require a rather lot of memory. The difference
between "a lot" and "three times a lot" could be significant.

But other than memory efficiency, yes, you are correct, there's no real
reason to care about the difference between the two cases.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#96579 — Re: Terminology: "reference" versus "pointer"

FromAkira Li <4kir4.1i@gmail.com>
Date2015-09-14 20:45 +0300
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<mailman.542.1442252812.8327.python-list@python.org>
In reply to#96445
Random832 <random832@fastmail.com> writes:

> On Mon, Sep 14, 2015, at 10:48, Akira Li wrote:
>> start, stop, step attributes (corresponding Python ints) may not exist
>> ("the objects we've talking about have never been created") until you
>> request them explicitly.
>
> That's not true in CPython. In fact, the range object in python contains
> *four* reference boxes - one more for length.

Even if it true in CPython. Specific implementations are irrelevant for
the discussions. Python -- the language -- does not mandate any
reference boxes (and given how you interpret the term "box" -- boxes are
not used anywhere).

>> I've mentioned it in another message but to be clear, I consider "parcel
>> tags" [1] and "box and arrows" [2] (boxes are always empty, they only
>> point to objects) models to be the same and different from "labelled
>> box" [3] model (boxes contain objects).
>
> See, I consider the box and arrow to be the same as the labeled box
> model - only the object the boxes contain is an arrow. Except for
> special kinds of boxes implemented in some other language, such as the
> elements of an array from the array module

   [box + arrow pointing to] + object == parcel tag + object

I could draw a picture but it won't be pretty.

"labelled box" model that assumes that objects are inside boxes is
clearly wrong -- it fails if you have two names that refer to the same
object in Python (you can't put the same object into different
boxes).

If a box contains nothing then there is no need for the box. If you
think the box contains "something" then find me the corresponding term
in Python language reference. I don't understand what is "arrow" that
the box might contain exactly. For example I can find what "name",
"object" mean in Python.

> The problem with "parcel tags" is that it represents namespaces - or one
> particular namespace, I've never seen any version of it that even
> clearly talks about locals, let alone different modules - differently
> from other kinds of objects.

I don't understand what are you trying to say here. If you have a
specific example when the "parcel tags" [1] model predicts a _wrong_
behavior; please do provide it. If your point is that "parcel tag" does
not describe in full detail all aspect of the behavior of an arbitrary
Python code then I agree with you (though none of the discussed models
can or should do it).

[toc] | [prev] | [next] | [standalone]


#96583 — Re: Terminology: "reference" versus "pointer"

FromRandom832 <random832@fastmail.com>
Date2015-09-14 14:00 -0400
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<mailman.546.1442253638.8327.python-list@python.org>
In reply to#96445
On Mon, Sep 14, 2015, at 13:45, Akira Li wrote:
>    [box + arrow pointing to] + object == parcel tag + object

The problem is that if there are multiple namespaces, or if you've also
got to include references from within other objects such as list, then
you've got to write all that somehow on the parcel tag, instead of just
having different places the arrows can start from.

The box and arrow model easily extends to this, and the fact that no-one
can make up their mind on what to *call* the thing the arrows represent
doesn't mean they don't exist.

[toc] | [prev] | [next] | [standalone]


#96586 — Re: Terminology: "reference" versus "pointer"

FromAkira Li <4kir4.1i@gmail.com>
Date2015-09-14 21:17 +0300
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<mailman.549.1442254766.8327.python-list@python.org>
In reply to#96445
Random832 <random832@fastmail.com> writes:

> On Mon, Sep 14, 2015, at 13:45, Akira Li wrote:
>>    [box + arrow pointing to] + object == parcel tag + object
>
> The problem is that if there are multiple namespaces, or if you've also
> got to include references from within other objects such as list, then
> you've got to write all that somehow on the parcel tag, instead of just
> having different places the arrows can start from.
>
> The box and arrow model easily extends to this, and the fact that no-one
> can make up their mind on what to *call* the thing the arrows represent
> doesn't mean they don't exist.

box has arrow, parcel tag has string/thread.
We could attach an arrow instead of a string to the parcel tag.

The box does not contain anything inside (we can attach the arrow
outside the box -- nothing changes).

If the box does not contain anything then we could use a parcel tag
instead.

[toc] | [prev] | [next] | [standalone]


#96434 — Re: Terminology: "reference" versus "pointer"

FromSteven D'Aprano <steve@pearwood.info>
Date2015-09-13 03:08 +1000
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<55f45c0f$0$1671$c3e8da3$5496439d@news.astraweb.com>
In reply to#96421
On Sat, 12 Sep 2015 10:46 pm, Rustom Mody wrote:

> On Saturday, September 12, 2015 at 11:57:01 AM UTC+5:30, Ben Finney wrote:

>> You've clearly committed to some ontology that just doesn't match the
>> Python data model.
> 
> How about lay-English ontology in which "point to" and "refer to" are
> fairly synonymous?

"Pointer" in English is also a synonym for 

- a type of dog;
- an instrument which pierces (as used by engravers, lace workers, etc); 
- an item of private information; 
- a hint or tip; 
- a caution or warning; 
- a recommendation; 
- the index finger; 
- a cricketer fielding at a specific position; 
- the hour/minute/second hand on a timepiece; 
- a compass needle; 
- two specific stars in the constellation of the Great Bear (Ursa Major);
-  diagonal braces fastened across the hold of a ship;
- the small icon whose movement across the screen follows that of the 
  mouse, trackball or other pointing device; 
- a signpost or milepost; 

and more. I don't think that arguing on the basis of lay-English or plain
English terms is going to be terribly useful.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#96440 — Re: Terminology: "reference" versus "pointer"

FromRustom Mody <rustompmody@gmail.com>
Date2015-09-12 10:26 -0700
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<1b27d8c8-f23e-4497-9b24-52066be0f66f@googlegroups.com>
In reply to#96434
On Saturday, September 12, 2015 at 10:38:46 PM UTC+5:30, Steven D'Aprano wrote:
> On Sat, 12 Sep 2015 10:46 pm, Rustom Mody wrote:
> 
> > On Saturday, September 12, 2015 at 11:57:01 AM UTC+5:30, Ben Finney wrote:
> 
> >> You've clearly committed to some ontology that just doesn't match the
> >> Python data model.
> > 
> > How about lay-English ontology in which "point to" and "refer to" are
> > fairly synonymous?
> 
> "Pointer" in English is also a synonym for 
> 
> - a type of dog;
> - an instrument which pierces (as used by engravers, lace workers, etc); 
> - an item of private information; 
> - a hint or tip; 
> - a caution or warning; 
> - a recommendation; 
> - the index finger; 
> - a cricketer fielding at a specific position; 
> - the hour/minute/second hand on a timepiece; 
> - a compass needle; 
> - two specific stars in the constellation of the Great Bear (Ursa Major);
> -  diagonal braces fastened across the hold of a ship;
> - the small icon whose movement across the screen follows that of the 
>   mouse, trackball or other pointing device; 
> - a signpost or milepost; 
> 
> and more. I don't think that arguing on the basis of lay-English or plain
> English terms is going to be terribly useful.

So if someone's ontology disagrees with yours its not very useful.
You're welcome to that view of course
Its called "Humpty-Dumpty" (in Alice ontology).

We could have had a more 'useful' discussion if alongside the meanings of 
"pointer" you had provided meanings of "reference" as well

[toc] | [prev] | [next] | [standalone]


#96477 — Re: Terminology: "reference" versus "pointer"

FromBen Finney <ben+python@benfinney.id.au>
Date2015-09-13 11:13 +1000
SubjectRe: Terminology: "reference" versus "pointer"
Message-ID<mailman.459.1442106800.8327.python-list@python.org>
In reply to#96421
Rustom Mody <rustompmody@gmail.com> writes:

> On Saturday, September 12, 2015 at 11:57:01 AM UTC+5:30, Ben Finney wrote:
> > You've clearly committed to some ontology that just doesn't match
> > the Python data model.
>
> How about lay-English ontology in which "point to" and "refer to" are fairly
> synonymous?

That's important. It's unrelated, though, to the very specific technical
programming concepts to which I was responding.

-- 
 \          “One bad programmer can easily create two new jobs a year. |
  `\      Hiring more bad programmers will just increase our perceived |
_o__)                     need for them.” —David Lorge Parnas, 1999-03 |
Ben Finney

[toc] | [prev] | [next] | [standalone]


#96415

FromChris Angelico <rosuav@gmail.com>
Date2015-09-12 16:27 +1000
Message-ID<mailman.420.1442039270.8327.python-list@python.org>
In reply to#96369
On Sat, Sep 12, 2015 at 4:25 PM, Random832 <random832@fastmail.com> wrote:
> Chris Angelico <rosuav@gmail.com> writes:
>> Here. Ned Batchelder explains it better than I can.
>
> See, those diagrams are perfect (well, almost, I think the names should
> have square boxes too). They're arrows. They *point* at
> things. *Pointers*.
>
> The boxes are variables. The circles represent special boxes
> (implemented in C or Java or whatever) that hold things other than
> pointers and therefore can't be used as Python variables.

Okay, okay, you've won. They're pointers. Now, try to do anything with
them. They *instantly* devolve to their referent objects, which means
you cannot do anything with the pointer at all. Congratulations,
pointers do not exist.

ChrisA

[toc] | [prev] | [next] | [standalone]


#96416 — Re: Terminology: “reference” versus “pointer”

FromChris Angelico <rosuav@gmail.com>
Date2015-09-12 16:31 +1000
SubjectRe: Terminology: “reference” versus “pointer”
Message-ID<mailman.421.1442039484.8327.python-list@python.org>
In reply to#96369
On Sat, Sep 12, 2015 at 4:26 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> If you do agree with those, some corollaries follow:
>
> * Container types do not contain objects.
>
>   It is a useful analogy to say the objects are “in” the container; but
>   that would imply they are not simultaneously in any other container.
>   That's not true, so it's a flawed (though very useful) analogy.

It's so useful that we have an operator called "in", implemented using
a magic method "__contains__", to test exactly that concept. As long
as you understand that containment here really means something more
like "is accessible from", it's correct. Flawed in a minor way, but so
extremely convenient that it's not worth going for complete technical
correctness.

ChrisA

[toc] | [prev] | [next] | [standalone]


#96370

FromIan Kelly <ian.g.kelly@gmail.com>
Date2015-09-11 16:10 -0600
Message-ID<mailman.381.1442009457.8327.python-list@python.org>
In reply to#96368
On Fri, Sep 11, 2015 at 3:26 PM,  <tdev@freenet.de> wrote:
> Ad hominem.
> There is a slogan: "There are always two persons involved"
> This I dont want talk about. I dont go into such a discussion.
> It seems more a problem of misinterpretations.

I think you misunderstand my comment. The paragraph that I was
responding to commits the ad hominem logical fallacy by supposing that
the credentials of the person making an argument have any bearing on
the validity of the argument. It therefore is dismissed as being
poorly reasoned. I point this out not to criticize, but to point out
that your argument is fallacious.

> But you can say, the "general" sample is:
> You have to specify global that the compiler can distinguish
> between local and global
> Other words: global is needed to distinct global from local.

This is not what I would consider a sample. I thought you were
referring to actual code examples demonstrating something.

> But this is "not" true.
> You specify global cause you want write access.
> Even the rules specified proves it:
>
>> 1) If it's in the function's argument list, it's an argument (and
>> therefore local).
>> 2) If it's explicitly declared global, then it's global.
>> 3) If it's never assigned within the function, then it's global.
>> 4) Otherwise, it's local.
>
> Take step 2 out than it is again recognized as global.
> So the global keyword is not needed to distinguish global from local.
> Rule 3 proves it.

Rule 3 works because it's generally safe to assume that a variable
that is never assigned locally can't be local; any attempt to access
it would result in an UnboundLocalError. (I say "generally" because
this assumption only holds as long as it's not possible to set locals
via eval or by updating locals(). That's true in the C implementation
of Python but not necessarily true in other implementations.)

Rule 3 doesn't imply that the compiler is capable of distinguishing
globals from locals. It's a guess based on a rule of thumb. So it's
less accurate to say that "you specify global cause you want write
access" and more accurate to say that "you specify global in cases
where the compiler can't guess it without assistance". It just so
happens that the two line up with one another.

> Surprisingly this runs now.
> Sometimes I run into indentations errors similiar to sample above for no reasons
> (maybe cause of existing spaces on the end of a line - next occurences I will try to note it down)
> But I have to remove this proposal for now.
> Sorry.

Yes, you can already choose between tabs or spaces for indentation.
You just can't mix them within the same code block.

[toc] | [prev] | [next] | [standalone]


#96373

FromMRAB <python@mrabarnett.plus.com>
Date2015-09-12 00:03 +0100
Message-ID<mailman.383.1442012638.8327.python-list@python.org>
In reply to#96368
On 2015-09-11 22:26, tdev@freenet.de wrote:
> Reflecting latest answers to global and "proposals"
>
[snip]

> But you can say, the "general" sample is:
> You have to specify global that the compiler can distinguish
> between local and global
> Other words: global is needed to distinct global from local.
>
> But this is "not" true.
> You specify global cause you want write access.
> Even the rules specified proves it:
>
>> 1) If it's in the function's argument list, it's an argument (and
>> therefore local).
>> 2) If it's explicitly declared global, then it's global.
>> 3) If it's never assigned within the function, then it's global.
>> 4) Otherwise, it's local.
>
> Take step 2 out than it is again recognized as global.
> So the global keyword is not needed to distinguish global from local.
> Rule 3 proves it.
>
I'd would rephrase 3 and 4:

1) If it's in the function's argument list, it's local.

2) If it's declared global, it's global.

3) If it's assigned within the function, it's local.

4) Otherwise, it's global.

>
> Conclusion.
> I will use Python, but never become a Pythonier,
> although quite conform with its philosophy "One best way".
> But even a traditional switch is denied, although much clearer
> in reading and writing than any if-else construct.
> I can and will not understand it.
>
No-one can decide on how it should be written without it looking
syntactically inconsistent in some way compared to the other control 
structures.

>
> Thanks for your answers.
>
>

[toc] | [prev] | [standalone]


Page 7 of 7 — ← Prev page 1 2 3 4 5 6 [7]

Back to top | Article view | comp.lang.python


csiph-web