Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread Chris Angelico
On Wed, Sep 27, 2017 at 5:24 AM, Grant Edwards
 wrote:
> On 2017-09-26, alister via Python-list  wrote:
>> On Tue, 26 Sep 2017 14:16:47 +, Grant Edwards wrote:
>>
>>> On 2017-09-26, Ned Batchelder  wrote:
 On 9/25/17 10:20 PM, Steve D'Aprano wrote:
> On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
> [...]
>
>
>
 We've been asked nicely by the list mod to stop :)
>>>
>>> Perhaps we could agree on a subject line tag to be used in all threas
>>> arguing about what to call the Python argument passing scheme?  That way
>>> the other 99% of us could pre-emptively plonk it?
>>
>> so you are suggesting a system where we could reject by reference :-)
>
> That depends on what you mean by "reference".
>
> And what you mean by "mean".

Well, *obviously*, reference is the section of the library that you're
not allowed to borrow, and "mean" is the average of a set of numbers.

Which means that CPython is breaking the rules every time it returns a
"borrowed reference".

ChrisA
joke-taker-too-far
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread Grant Edwards
On 2017-09-26, alister via Python-list  wrote:
> On Tue, 26 Sep 2017 14:16:47 +, Grant Edwards wrote:
>
>> On 2017-09-26, Ned Batchelder  wrote:
>>> On 9/25/17 10:20 PM, Steve D'Aprano wrote:
 On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
 [...]



>>> We've been asked nicely by the list mod to stop :)
>> 
>> Perhaps we could agree on a subject line tag to be used in all threas
>> arguing about what to call the Python argument passing scheme?  That way
>> the other 99% of us could pre-emptively plonk it?
>
> so you are suggesting a system where we could reject by reference :-)

That depends on what you mean by "reference".

And what you mean by "mean".

-- 
Grant Edwards   grant.b.edwardsYow! It's some people
  at   inside the wall!  This is
  gmail.combetter than mopping!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread Tim Chase
On 2017-09-26 18:25, alister via Python-list wrote:
>>> We've been asked nicely by the list mod to stop :)  
>> 
>> Perhaps we could agree on a subject line tag to be used in all
>> threas arguing about what to call the Python argument passing
>> scheme?  That way the other 99% of us could pre-emptively plonk
>> it?  
> 
> so you are suggesting a system where we could reject by
> reference :-)

I think the suggestion is to bind a name to the thread and reject by
name-binding.

Grinning-ducking-and-running'ly yers...

-tkc


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread Chris Angelico
On Wed, Sep 27, 2017 at 4:25 AM, alister via Python-list
 wrote:
> On Tue, 26 Sep 2017 14:16:47 +, Grant Edwards wrote:
>
>> On 2017-09-26, Ned Batchelder  wrote:
>>> On 9/25/17 10:20 PM, Steve D'Aprano wrote:
 On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
 [...]



>>> We've been asked nicely by the list mod to stop :)
>>
>> Perhaps we could agree on a subject line tag to be used in all threas
>> arguing about what to call the Python argument passing scheme?  That way
>> the other 99% of us could pre-emptively plonk it?
>
> so you are suggesting a system where we could reject by reference :-)

No, you don't actually reject them. You allow them to be posted, but
you simply skip over the ones you don't like. You pass them by.

That's the REAL meaning of "pass by reference".

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread alister via Python-list
On Tue, 26 Sep 2017 14:16:47 +, Grant Edwards wrote:

> On 2017-09-26, Ned Batchelder  wrote:
>> On 9/25/17 10:20 PM, Steve D'Aprano wrote:
>>> On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
>>> [...]
>>>
>>>
>>>
>> We've been asked nicely by the list mod to stop :)
> 
> Perhaps we could agree on a subject line tag to be used in all threas
> arguing about what to call the Python argument passing scheme?  That way
> the other 99% of us could pre-emptively plonk it?

so you are suggesting a system where we could reject by reference :-)



-- 
hard, adj.:
The quality of your own data; also how it is to believe those
of other people.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread Tim Golden

On 26/09/2017 15:16, Grant Edwards wrote:

On 2017-09-26, Ned Batchelder  wrote:

On 9/25/17 10:20 PM, Steve D'Aprano wrote:

On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
[...]




We've been asked nicely by the list mod to stop :)


Perhaps we could agree on a subject line tag to be used in all threas
arguing about what to call the Python argument passing scheme?  That
way the other 99% of us could pre-emptively plonk it?


+100

:)

TJG

--
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-26 Thread Grant Edwards
On 2017-09-26, Ned Batchelder  wrote:
> On 9/25/17 10:20 PM, Steve D'Aprano wrote:
>> On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
>> [...]
>>
>>
>
> We've been asked nicely by the list mod to stop :)

Perhaps we could agree on a subject line tag to be used in all threas
arguing about what to call the Python argument passing scheme?  That
way the other 99% of us could pre-emptively plonk it?

-- 
Grant Edwards   grant.b.edwardsYow! My BIOLOGICAL ALARM
  at   CLOCK just went off ... It
  gmail.comhas noiseless DOZE FUNCTION
   and full kitchen!!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Ned Batchelder

On 9/25/17 10:20 PM, Steve D'Aprano wrote:

On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
[...]




We've been asked nicely by the list mod to stop :)

--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Steve D'Aprano
On Tue, 26 Sep 2017 02:54 am, Ned Batchelder wrote:
[...]

Heh, its hard to avoid getting sucked into the sinkhole of definitional debates,
isn't it? :-)

[...]
> But in this line:
> 
>  x = 2 + 2
> 
> You can say,
> 
>  the value of x is 4

If we're talking about the highest level abstraction level, namely the Python
code, that would be the right answer. Provided that we understand that as
short-hand for:

>  the value of x is an int object with a value of 4

However:

> or,
> 
>  the value of x is a reference to an int object with a value of 4,

while that's true from a certain perspective, it's not the high-level Python
perspective. Its that of the implementation.

It's a perfectly valid perspective, and its often not just useful but (almost)
necessary. Some behaviours of Python are difficult to understand unless we dip
down an abstraction level and look at the implementation.


> and in some ways, each of those is a correct statement. They are
> different perspectives on the same complicated abstract relationships
> inside your program.  Most of the disagreements in this thread stem from
> someone picking one of those three statements and insisting that it is
> *the* right statement, or from differing interpretations of words like
> value, reference, pointer, alias, etc.

This topic has been discussed a lot over the last few weeks/months, and that's
something I've  also said: it is useful if not necessary to discuss different
levels of abstractions, but one needs to be clear when you are doing so.

We all take verbal short-cuts from time to time, and I'll often use language
like

"evaluating the expression returns a reference (a pointer) to the object ..."

(language which Marko would, I think, agree with) if I feel it brings insight to
the question being discussed. From a purely pedantic point of view, I'll say
I'm slightly naughty to do so, because I'm crossing abstractions without being
explicit about it. "Explicit is better than implicit."

So we all do it. I have no problem with people taking short-cuts or crossing
abstractions and even mixing explanations from different levels, provided it
brings insight and clarity to the question rather than confusion.

Its better to be explicit about it when you do so ("under the hood, the
interpreter uses a pointer to the object...") but we're all only human and
sometimes we make implicit assumptions.

But I do have to wonder about people who insist on keeping an inflexible,
single-minded point of view even in the face of confusion. To use your analogy
from below, it is as if they were absolutely, categorically denying that
pressing the gas pedal (accelerator pedal) has anything to do with the car
moving, because its the engine that makes it move, and that's the only right
answer.

Its fine to discuss what happens in different abstraction layers, but be clear
about it when you do.


> Software gets complicated because it involves multiple levels of
> abstraction layered on top of each other.  We might as well be arguing
> like this:
> 
>  A: "The gas pedal makes the car go"
> 
>  B: "Nonsense! The gas pedal supplies fuel to the engine, it's the 
> engine that makes the car go"
[snip]

Indeed. 


-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Antoon Pardon
On 25-09-17 18:29, Steve D'Aprano wrote:

> 
> Regardless of whether I'm using Python, Swift, Java, C, Pascal or Scheme, if I
> write something like:
> 
> x = Parrot(name="Polly")
> 
> (using Python syntax for simplicity) and somebody tries to tell me that the
> value of x is anything but a Parrot instance named "Polly", I have no time for
> that sort of nonsense. They might as well tell me that I'm typing this 
> response
> on an elephant.

And if you write it like that, implying that the assignment semantics is the
same for all these languages, I'm not surprises people get confused.

-- 
Antoon Pardon.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Chris Angelico
On Tue, Sep 26, 2017 at 2:52 AM, Tim Chase
 wrote:
> On 2017-09-26 02:29, Steve D'Aprano wrote:
>> x = Parrot(name="Polly")
>>
>> (using Python syntax for simplicity) and somebody tries to tell me
>> that the value of x is anything but a Parrot instance named "Polly",
>
> So this is a Polly-morphic constructor?

Steve actually said:

> Regardless of whether I'm using Python, Swift, Java, C, Pascal or Scheme, if I
> write something like:

So it's actually Polly-glot.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Tim Chase
On 2017-09-26 02:29, Steve D'Aprano wrote:
> x = Parrot(name="Polly")
> 
> (using Python syntax for simplicity) and somebody tries to tell me
> that the value of x is anything but a Parrot instance named "Polly",

So this is a Polly-morphic constructor?

-tkc


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Ned Batchelder

On 9/25/17 12:29 PM, Steve D'Aprano wrote:

Regardless of whether I'm using Python, Swift, Java, C, Pascal or Scheme, if I
write something like:

x = Parrot(name="Polly")

(using Python syntax for simplicity) and somebody tries to tell me that the
value of x is anything but a Parrot instance named "Polly", I have no time for
that sort of nonsense. They might as well tell me that I'm typing this response
on an elephant.


But in this line:

    x = 2 + 2

You can say,

    the value of x is 4

or,

    the value of x is an int object with a value of 4

or,

    the value of x is a reference to an int object with a value of 4,

and in some ways, each of those is a correct statement. They are 
different perspectives on the same complicated abstract relationships 
inside your program.  Most of the disagreements in this thread stem from 
someone picking one of those three statements and insisting that it is 
*the* right statement, or from differing interpretations of words like 
value, reference, pointer, alias, etc.


Software gets complicated because it involves multiple levels of 
abstraction layered on top of each other.  We might as well be arguing 
like this:


    A: "The gas pedal makes the car go"

    B: "Nonsense! The gas pedal supplies fuel to the engine, it's the 
engine that makes the car go"


    C: "None of you know what you are talking about! The engine merely 
turns the axle. It's the wheels that make the car go!"


    D: "The wheels only work because of the friction between rubber and 
asphalt!"


etc etc etc.

--Ned.
--
https://mail.python.org/mailman/listinfo/python-list


Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Steve D'Aprano
On Mon, 25 Sep 2017 10:53 pm, Ned Batchelder wrote:

> Would we be able to end these interminable debates if we just agree that
> we all know how it works, 

If only that were true. Not everyone understands Python semantics (or for that
matter, Java/Swift/language of your choice) and I still come across people
confused by the pass by value/reference false dichotomy and which applies to
.


> and it isn't important to come up with a 
> simple name for what it is?

Isn't it?

I find it really difficult to understand people when the meanings they apply to
words are not the same as the ones I use.

Or perhaps I should say:

I disintegrate it really snooze to pyramid running when the ribbons they
apply to sandwiches are not the same as the sleep I use.


*wink*


> It seems clear to me that "value" and 
> "reference" are wildly vague terms, used slightly differently by each
> language, and by different people even in the same language if they have
> different perspectives.

Honestly Ned, I don't think that's right. I think you're being awfully
accommodating to what I see as some really egregious misuse of language. I
don't think that "value", in particular, is a vague term.

(I might be persuaded to accept that "reference" has some ambiguity.)

Regardless of whether I'm using Python, Swift, Java, C, Pascal or Scheme, if I
write something like:

x = Parrot(name="Polly")

(using Python syntax for simplicity) and somebody tries to tell me that the
value of x is anything but a Parrot instance named "Polly", I have no time for
that sort of nonsense. They might as well tell me that I'm typing this response
on an elephant.


> Can't we just stop? :)

You take all the fun out of being right on the internet.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list