On Tue, Sep 26, 2017 11:00 PM, Steve D'Aprano
wrote:
>
The critical distinction here is whether the names refer to each other:
>
>a <---> b
>
>or whether they merely refer to the same value:
>
>a ---> [ value ] <--- b
>
>
>Python uses the second model. Var parameters
Op 27-09-17 om 09:38 schreef Steven D'Aprano:
No, the model that C++ and Pascal use is not different in this aspect.
> that Pascal var parameters and C++ reference variables operate the same
> way as Python variable assignment, the *kindest* thing I can say is that
> you are ignorant.
The
Op 27-09-17 om 10:11 schreef Chris Angelico:
> On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano
> wrote:
>> Twice you have claimed to be able to write such a swap procedure for
>> lists. You can't. If you think you can, it is only because you have
>>
On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano
wrote:
> Twice you have claimed to be able to write such a swap procedure for
> lists. You can't. If you think you can, it is only because you have
> misunderstood the problem and are writing something else
On Wed, 27 Sep 2017 08:56:03 +0200, Antoon Pardon wrote:
>> But that's not enough for the variable b to be an alias for the
>> variable a.
>
> Yes it is!
Since you seem to be intent on inventing your own meanings for well
established words, for the confusion and misinformation of all, I can
Op 27-09-17 om 04:58 schreef Steve D'Aprano:
> A pedantic difference that makes no difference to my argument.
>
> I see that you ignored the later assignment:
>
> b = 2;
>
> which also assigned to a. *That** is the fundamental point: b is certainly an
> alias for a, and assigning to b assigns to
Op 27-09-17 om 04:58 schreef Steve D'Aprano:
> On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote:
>
>> Steve D'Aprano writes:
>>> On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote:
at that moment, but it still needed correction. If the assignment is
an alias
Steve D'Aprano wrote:
On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote:
Steve D'Aprano writes:
On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote:
at that moment, but it still needed correction. If the assignment is
an alias operator then after the statements
On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote:
> Steve D'Aprano writes:
>>On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote:
>>>at that moment, but it still needed correction. If the assignment is
>>>an alias operator then after the statements
>>Here's some C++ code
On Tue, Sep 26, 2017 12:00 PM, Steve D'Aprano
wrote:
>
> a = 1
>> b = a
>> b = 2
>>
>> a is not 2.
>
< snip >
int main () {
> int a;
> int& b = a; // reference variable or alias
>
> a = 1;
> printf("a: %d, alias b: %d\n", a, b);
> b = 2;
> printf("a:
Rhodri James :
> On 25/09/17 20:40, Marko Rauhamaa wrote:
>> A pointer is something that points to a data object.
>
> In that case you are using "pointer" in such an informal sense that
> making deductions from it is unlikely to be successful.
Propose a name for the
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
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
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
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,
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
On 26-09-17 14:28, Steve D'Aprano wrote:
> On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote:
>
>> Sorry, what he wrote contradicts that. Maybe he was just really confused
>> at that moment, but it still needed correction. If the assignment is
>> an alias operator then after the statements
>>
>>
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
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
On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote:
>>> I'm not sure that Steve knows how it works. When he denies that the
>>> assignment is an alias operation in Python that casts an important doubt.
>>
>> I can assure you that Steve knows how it works. Again, the disagreement is
>> almost
On 25/09/17 21:00, Tim Golden wrote:
(Slight sigh). Can I step in as a list owner and ask the people who are
so very fond of debating this topic again and again: please let it drop.
But, but... someone on the internet is wrong!
On 25/09/17 20:40, Marko Rauhamaa wrote:
Rhodri James :
On 25/09/17 15:26, Marko Rauhamaa wrote:
That's not what I said. I said all expressions *evaluate to* pointers.
This may well be true in particular implementations, but it is an
implementation detail so Chris'
Chris Angelico :
> I've explained Python's (or JavaScript's, since they're the same)
> object model to a number of novice programmers without any
> difficulties, without talking about pointers or invisible values or
> any of that junk. There are just two things to explain: the
Op 25-09-17 om 21:44 schreef Ned Batchelder:
>
> Wikipedia has the right definition of call by reference
> (https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_reference):
>
> /Call by reference/ (also referred to as /pass by reference/) is an
> evaluation strategy where a function
Antoon Pardon wrote:
It also says: This typically means that the function can modify the variable
used as argument, something Python can do that.
No, it can't. It can modify the *object* bound to the variable,
but *not* the variable itself.
If you think it can, then you're misunderstanding
On Tue, Sep 26, 2017 at 4:25 PM, Gregory Ewing
wrote:
> Neil Cerutti wrote:
>>
>> The quest to find a succinct way to categorize Python's argument
>> passing for non-Python programmers strikes me as a sincere effort
>> to to simplify something that just isn't simple.
Neil Cerutti wrote:
The quest to find a succinct way to categorize Python's argument
passing for non-Python programmers strikes me as a sincere effort
to to simplify something that just isn't simple.
I don't see how it's useful to do that in the first place.
Under what circumstances would you
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
Tim Golden wrote:
On 25/09/2017 20:40, Marko Rauhamaa wrote:
Rhodri James :
On 25/09/17 15:26, Marko Rauhamaa wrote:
That's not what I said. I said all expressions *evaluate to* pointers.
This may well be true in particular implementations, but it is an
implementation
Chris Angelico wrote:
On Tue, Sep 26, 2017 at 5:35 AM, Marko Rauhamaa wrote:
Chris Angelico :
On Tue, Sep 26, 2017 at 12:26 AM, Marko Rauhamaa wrote:
Sorry, that was my bad in the terminology. But where do you get that
all Python
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
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
On 25-09-17 21:44, Ned Batchelder wrote:
> On 9/25/17 5:32 AM, Antoon Pardon wrote:
>> Can you explain, what you mean by "Pass-By-Reference" as far a I understand,
>> pass by reference means that the parameter of the function becomes an alias
>> of the argument, so that if the entity is mutated
Chris Angelico :
> On Tue, Sep 26, 2017 at 5:36 AM, Marko Rauhamaa wrote:
>> Chris Angelico :
>>> You need *some* support for your assertion that there are pointers,
>>
>> What would convince you?
>
> Evidence, or a statement from the
On Tue, Sep 26, 2017 at 5:51 AM, Stefan Ram wrote:
> Ned Batchelder writes:
>>Wikipedia has the right definition of call by reference
>
> Assertions can be right or wrong.
>
> Definitions cannot be right or wrong.
You have made two
On Tue, Sep 26, 2017 at 5:36 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>> You need *some* support for your assertion that there are pointers,
>
> What would convince you?
Evidence, or a statement from the documentation.
ChrisA
--
Rhodri James :
> On 25/09/17 15:26, Marko Rauhamaa wrote:
>> That's not what I said. I said all expressions *evaluate to* pointers.
>
> This may well be true in particular implementations, but it is an
> implementation detail so Chris' point still stands. Another
>
On Tue, Sep 26, 2017 at 5:35 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Tue, Sep 26, 2017 at 12:26 AM, Marko Rauhamaa wrote:
>> Sorry, that was my bad in the terminology. But where do you get that
>> all Python expressions evaluate
Chris Angelico :
> On Tue, Sep 26, 2017 at 12:26 AM, Marko Rauhamaa wrote:
> Sorry, that was my bad in the terminology. But where do you get that
> all Python expressions evaluate to pointers?
What do they evaluate to if not pointers? Anton's "identities"
On Tue, Sep 26, 2017 at 4:30 AM, Antoon Pardon
wrote:
> On 25-09-17 20:01, Chris Angelico wrote:
>> On Tue, Sep 26, 2017 at 3:54 AM, Antoon Pardon
>> wrote:
>>> On 25-09-17 19:31, Chris Angelico wrote:
If by "identity" you mean the
On 25-09-17 20:01, Chris Angelico wrote:
> On Tue, Sep 26, 2017 at 3:54 AM, Antoon Pardon
> wrote:
>> On 25-09-17 19:31, Chris Angelico wrote:
>>> If by "identity" you mean the integer values returned by id(), then
>>> nope, you're still wrong - there is no mapping
On 25/09/17 15:26, Marko Rauhamaa wrote:
Chris Angelico :
On Mon, Sep 25, 2017 at 7:41 PM, Marko Rauhamaa wrote:
In Python, all expressions evaluate pointers.
And that's an assertion that isn't backed by anything in the Python
specification. Where do you
I would claim that these two paragraphs do not agree.
What is stored in the variable in Pascal?
In declared variables and value parameters, the value itself.
Let's just temporarily stipulate that for reference parameters
and pointer variables actually store a pointer to the object.
Where is it
On 25-09-17 19:31, Chris Angelico wrote:
> On Tue, Sep 26, 2017 at 3:04 AM, Antoon Pardon
> wrote:
>> On 25-09-17 16:29, Marko Rauhamaa wrote:
>>> Antoon Pardon :
>>>
Op 25-09-17 om 15:16 schreef Marko Rauhamaa:
> No, I'm not. I'm
On Tue, Sep 26, 2017 at 12:26 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Mon, Sep 25, 2017 at 7:41 PM, Marko Rauhamaa wrote:
>>> In Python, all expressions evaluate pointers.
>>
>> And that's an assertion that isn't backed by
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
On Tue, Sep 26, 2017 at 3:04 AM, Antoon Pardon
wrote:
> On 25-09-17 16:29, Marko Rauhamaa wrote:
>> Antoon Pardon :
>>
>>> Op 25-09-17 om 15:16 schreef Marko Rauhamaa:
No, I'm not. I'm talking about pointers in the abstract sense, both in
On 25-09-17 15:37, Ned Batchelder wrote:
> On 9/25/17 9:15 AM, Antoon Pardon wrote:
>> Op 25-09-17 om 14:53 schreef Ned Batchelder:
>>> On 9/25/17 8:24 AM, Steve D'Aprano wrote:
On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
> Pass by reference doesn't imply being able to
>
On 25-09-17 16:29, Marko Rauhamaa wrote:
> Antoon Pardon :
>
>> Op 25-09-17 om 15:16 schreef Marko Rauhamaa:
>>> No, I'm not. I'm talking about pointers in the abstract sense, both in
>>> case of Python and Pascal. Neither language gives any hint as to the
>>> physical
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
--
On Sun, 24 Sep 2017 09:13 am, Bill wrote:
[context snipped for brevity]
> I agree (I was a bit hasty in my choice of words); but if they didn't
> "have" these references, it would be difficult, though not impossible,
> to refer to them. Also keep in mind that the garbage collector keeps
>
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
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
On 9/25/17 9:15 AM, Antoon Pardon wrote:
Op 25-09-17 om 14:53 schreef Ned Batchelder:
On 9/25/17 8:24 AM, Steve D'Aprano wrote:
On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
Pass by reference doesn't imply being able to
write a swap function.
Really. Do you have a counter-example?
A
Chris Angelico :
> On Mon, Sep 25, 2017 at 7:41 PM, Marko Rauhamaa wrote:
>> In Python, all expressions evaluate pointers.
>
> And that's an assertion that isn't backed by anything in the Python
> specification. Where do you get that all Python expressions are
Antoon Pardon :
> Op 25-09-17 om 15:16 schreef Marko Rauhamaa:
>> No, I'm not. I'm talking about pointers in the abstract sense, both in
>> case of Python and Pascal. Neither language gives any hint as to the
>> physical nature of the pointer.
>
> Yes you are. Python doesn't
On Mon, Sep 25, 2017 at 7:41 PM, Marko Rauhamaa wrote:
> Antoon Pardon :
>
>> the semantics of an assignment depends on the language
>
> I've only seen one kind of assignment in the general-purpose programming
> languages I know, maybe with the exception of
Op 25-09-17 om 15:16 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> Op 25-09-17 om 14:16 schreef Marko Rauhamaa:
>>> Python only operates with pointers. You can operate with pointers in
>>> Pascal as well.
>> You are talking about implementation details.
> No, I'm not. I'm
Antoon Pardon :
> Op 25-09-17 om 14:16 schreef Marko Rauhamaa:
>> Python only operates with pointers. You can operate with pointers in
>> Pascal as well.
>
> You are talking about implementation details.
No, I'm not. I'm talking about pointers in the abstract sense, both in
Op 25-09-17 om 14:53 schreef Ned Batchelder:
> On 9/25/17 8:24 AM, Steve D'Aprano wrote:
>> On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
>>
>>> Pass by reference doesn't imply being able to
>>> write a swap function.
>> Really. Do you have a counter-example?
>>
>>
>>> A swap function as
Op 25-09-17 om 14:16 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> Op 25-09-17 om 13:32 schreef Marko Rauhamaa:
>>> In Python, assignment "mutates the target" as well. It's only that in
>>> Python, the target is always a pointer.
>> Fine if you want to word it like that, the
On 9/25/17 8:24 AM, Steve D'Aprano wrote:
On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
Pass by reference doesn't imply being able to
write a swap function.
Really. Do you have a counter-example?
A swap function as possible in pascal requires two conditions.
1) Pass by reference
2)
Op 25-09-17 om 14:24 schreef Steve D'Aprano:
> On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
>
>> Pass by reference doesn't imply being able to
>> write a swap function.
> Really. Do you have a counter-example?
Python, smalltalk, scheme.
>
>
>> A swap function as possible in pascal requires
On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
> Pass by reference doesn't imply being able to
> write a swap function.
Really. Do you have a counter-example?
> A swap function as possible in pascal requires two conditions.
>
> 1) Pass by reference
> 2) Copy-over assignment.
I don't know
Antoon Pardon :
> Op 25-09-17 om 13:32 schreef Marko Rauhamaa:
>> In Python, assignment "mutates the target" as well. It's only that in
>> Python, the target is always a pointer.
>
> Fine if you want to word it like that, the assignments in Pascal and
> Python are still
Op 25-09-17 om 13:32 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> Op 25-09-17 om 11:41 schreef Marko Rauhamaa:
>>> Antoon Pardon :
>>>
the semantics of an assignment depends on the language
>>> I've only seen one kind of assignment in the
Antoon Pardon :
> Op 25-09-17 om 11:41 schreef Marko Rauhamaa:
>> Antoon Pardon :
>>
>>> the semantics of an assignment depends on the language
>> I've only seen one kind of assignment in the general-purpose
>> programming languages I know,
Op 25-09-17 om 11:41 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> the semantics of an assignment depends on the language
> I've only seen one kind of assignment in the general-purpose programming
> languages I know, maybe with the exception of Prolog and Rust.
I disagree.
Op 22-09-17 om 15:30 schreef Steve D'Aprano:
> On Fri, 22 Sep 2017 10:27 pm, Marko Rauhamaa wrote:
>
>> r...@zedat.fu-berlin.de (Stefan Ram):
>>
>>> Marko Rauhamaa writes:
swap(slot_ref(locals(), "x"), slot_ref(locals(), "y"))
>>> You need to be able to write the call as
Antoon Pardon :
> the semantics of an assignment depends on the language
I've only seen one kind of assignment in the general-purpose programming
languages I know, maybe with the exception of Prolog and Rust.
So the assignment is the same everywhere, only the evaluation
Op 24-09-17 om 04:13 schreef Steve D'Aprano:
>> and consider
>> that something else has to happen as an alternative, and (2) understand
>> that in Python, objects don't have names, they have references (which
>> have names). The rest could be "implementation dependent" (no?)
> No.
>
> There are
Op 25-09-17 om 00:39 schreef Gregory Ewing:
> Dennis Lee Bieber wrote:
>> "Binding" itself tends to be Python specific terminology -- in
>> that it
>> is the parameter /name/ that gets bound/attached to the argument
>> /object/.
>> It is the same method as used in any Python "assignment"
Steve D'Aprano wrote:
I think that suffers from the same problem as "call by binding" -- assignment is
too general a word.
If you're learning a new language, you're almost certainly
going to learn how assignment works in that language before
you get as far as worrying about parameter passing.
Dennis Lee Bieber wrote:
Though "assignment" differs so much between languages
That's the point of the term -- it's the same as whatever
assignment does in the language concerned.
This is true of *every* language I know of that uses the
term "call by value" in its official
On Mon, 25 Sep 2017 08:39 am, Gregory Ewing wrote:
> Dennis Lee Bieber wrote:
>> "Binding" itself tends to be Python specific terminology -- in that it
"Binding" is certainly not Python-specific:
https://en.wikipedia.org/wiki/Name_binding
and here's an example of the term in use:
On Sun, 24 Sep 2017 12:37 pm, Bill wrote:
>> For example, if I made "Pass-By-Reference Python" where all argument passing
>> was done by reference, my language would differ from real Python:
>>
>>
>> function(x, y) # allowed
>> function(namespace.x, module.y) # allowed
>> function(x + 1, 2) #
On Mon, 25 Sep 2017 01:56 am, bartc wrote:
>> The point I am making is that we could describe just about any and all
>> languages with functions "call by binding", whether they are call by value
>> like C, call by reference like Fortran, call by need like Haskell, or call by
>> sharing like
Dennis Lee Bieber wrote:
"Binding" itself tends to be Python specific terminology -- in that it
is the parameter /name/ that gets bound/attached to the argument /object/.
It is the same method as used in any Python "assignment" statement,
Which is why I think "call by assignment" would
On 24/09/2017 15:49, Steve D'Aprano wrote:
On Mon, 25 Sep 2017 12:35 am, Stefan Ram wrote:
WRT to assertions about Python, I try to base them on the
"The Python Language Reference, Release 3.6.0" (PRL).
So, WRT to parameter passing, I would use this part of the PRL:
»The
On Mon, 25 Sep 2017 12:35 am, Stefan Ram wrote:
> WRT to assertions about Python, I try to base them on the
> "The Python Language Reference, Release 3.6.0" (PRL).
>
> So, WRT to parameter passing, I would use this part of the PRL:
>
> »The following constructs bind names: formal
Steve D'Aprano wrote:
On Sun, 24 Sep 2017 08:18 am, Bill wrote:
All one has to do, I think, is consider (1) that passing objects by
"making copies" of them, would be prohibitively expensive
Swift passes certain values (but not others!) by value and makes a copy. That
includes many
On Sun, 24 Sep 2017 08:18 am, Bill wrote:
> All one has to do, I think, is consider (1) that passing objects by
> "making copies" of them, would be prohibitively expensive
Swift passes certain values (but not others!) by value and makes a copy. That
includes many potentially large data types
On Sun, 24 Sep 2017 07:03 am, ROGER GRAYDON CHRISTMAN wrote:
> I usually do not encourage people to optimize correctness out of their code.
+1 quote of the week :-)
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
Chris Angelico wrote:
On Sun, Sep 24, 2017 at 8:18 AM, Bill wrote:
Stephan Houben wrote:
Op 2017-09-23, Rick Johnson schreef :
These pissing contests over how values are passed in Python
are totally irrelevant. What does it matter?
Stephan Houben wrote:
Op 2017-09-23, Rick Johnson schreef :
These pissing contests over how values are passed in Python
are totally irrelevant. What does it matter? Nothing will be
gained or lost by arguing over which is true, or not. Unless
the distinction is
On Fri, Sep 22, 2017 12:03 PM, Dennis Lee Bier wrote:>
On Fri, 22 Sep 2017 23:30:34 +1000, Steve D'Aprano
>
declaimed the following:
>
>The exercise is to demonstrate pass by reference semantics. That requires
>
>demonstrating the same
Op 2017-09-23, Rick Johnson schreef :
> These pissing contests over how values are passed in Python
> are totally irrelevant. What does it matter? Nothing will be
> gained or lost by arguing over which is true, or not. Unless
> the distinction is preventing you from
Mark Lawrence wrote:
> [...]
> I have no interest it what the C++ does, looks like or
> anything else. All I'm bothered about is that two highly
> respected members of the Python community have stated quite
> clearly that Python is call by object. Many other people
> have stated the same in this
On 23/09/2017 04:06, Bill wrote:
Mark Lawrence wrote:
On 22/09/2017 08:01, Bill wrote:
Steve D'Aprano wrote:
On Fri, 22 Sep 2017 02:57 pm, Bill wrote:
I find Python to be more more
like Java, with regard to "passing objects by reference".
Which is not a surprise, since both Python and Java
Bill wrote:
Mark Lawrence wrote:
On 22/09/2017 08:01, Bill wrote:
Steve D'Aprano wrote:
On Fri, 22 Sep 2017 02:57 pm, Bill wrote:
I find Python to be more more
like Java, with regard to "passing objects by reference".
Which is not a surprise, since both Python and Java use the same
value
Mark Lawrence wrote:
On 22/09/2017 08:01, Bill wrote:
Steve D'Aprano wrote:
On Fri, 22 Sep 2017 02:57 pm, Bill wrote:
I find Python to be more more
like Java, with regard to "passing objects by reference".
Which is not a surprise, since both Python and Java use the same
value passing
Chris Angelico :
> On Fri, Sep 22, 2017 at 10:26 PM, Marko Rauhamaa wrote:
>> Chris Angelico :
>>> (Side point: Your slot_ref function is rather bizarre. It's a closure
>>> AND a class, just in case one of them isn't sufficient.
>>
>> I don't
On Fri, Sep 22, 2017 at 10:26 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>> (Side point: Your slot_ref function is rather bizarre. It's a closure
>> AND a class, just in case one of them isn't sufficient.
>
> I don't see anything bizarre in it at all. I use
On Fri, 22 Sep 2017 10:27 pm, Marko Rauhamaa wrote:
> r...@zedat.fu-berlin.de (Stefan Ram):
>
>> Marko Rauhamaa writes:
>>>swap(slot_ref(locals(), "x"), slot_ref(locals(), "y"))
>>
>> You need to be able to write the call as
>>
>> swap( x, y )
>
> Why?
Because that's the
On 22/09/2017 13:34, Steve D'Aprano wrote:
On Fri, 22 Sep 2017 09:24 pm, Marko Rauhamaa wrote:
Yes, following my recipe:
def swap(ref_a, ref_b):
a, b = ref_a.get(), ref_b.get()
ref_a.set(b)
ref_b.set(a)
x = 10
y = "Z"
swap(slot_ref(locals(), "x"),
r...@zedat.fu-berlin.de (Stefan Ram):
> Marko Rauhamaa writes:
>>r...@zedat.fu-berlin.de (Stefan Ram):
>>>Marko Rauhamaa writes:
swap(slot_ref(locals(), "x"), slot_ref(locals(), "y"))
>>>You need to be able to write the call as
>>>swap( x, y )
>>Why?
>
>
On Fri, 22 Sep 2017 09:24 pm, Marko Rauhamaa wrote:
> bartc :
>
>> On 22/09/2017 10:23, Marko Rauhamaa wrote:
>>> However, Python doesn't need any language changes to implement memory
>>> slots. A memory slot could be defined as any object that implements
>>> "get()" and
r...@zedat.fu-berlin.de (Stefan Ram):
> Marko Rauhamaa writes:
>>swap(slot_ref(locals(), "x"), slot_ref(locals(), "y"))
>
> You need to be able to write the call as
>
> swap( x, y )
Why?
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico :
> Sure, let me just put that into a function. CPython 3.7, although I'm
> pretty sure most CPython versions will do the same, as will several of
> the other Pythons.
> [demonstration that it didn't work]
Ok. The reason is this:
Note: The contents of this
On 22/09/2017 10:53, Bill wrote:
I just wanted to mention that my comment was made in the context that
Python is implemented by an interpreter written in C. I realize that
this may not always be the case. However, I haven't heard anyone
mention a Python interpreter written in Python yet.
1 - 100 of 172 matches
Mail list logo