Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-21 Thread Ron Adam
On 06/20/2015 10:50 PM, Rustom Mody wrote: Here is Eric Snow: | Keep in mind that by immutability I'm talking about*really* | immutable, perhaps going so far as treating the full memory space | associated with an object as frozen. For instance, we'd have to | ensure that immutable Python

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-21 Thread Laura Creighton
In a message of Sat, 20 Jun 2015 19:50:21 -0700, Rustom Mody writes: Here is Eric Snow: | Keep in mind that by immutability I'm talking about *really* | immutable, perhaps going so far as treating the full memory space | associated with an object as frozen. For instance, we'd have to | ensure

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-20 Thread Rustom Mody
On Sunday, June 7, 2015 at 10:04:37 PM UTC+5:30, Chris Angelico wrote: On Mon, Jun 8, 2015 at 2:20 AM, Rustom Mody wrote: Ok now rewrite that para above with s/tuple/numbers like 3 or 666/ So I put '3' on the ram and grind it to finest powder. Have all trinities (of religious or secular

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-20 Thread Chris Angelico
On Sun, Jun 21, 2015 at 11:59 AM, Rustom Mody rustompm...@gmail.com wrote: Recent thread on python ideas https://mail.python.org/pipermail/python-ideas/2015-June/034177.html Since python's immutable ≠ really immutable, we now need a really immutable That's because it requires mutable memory

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-20 Thread Rustom Mody
On Sunday, June 21, 2015 at 8:03:18 AM UTC+5:30, Chris Angelico wrote: On Sun, Jun 21, 2015 at 11:59 AM, Rustom Mody wrote: Recent thread on python ideas https://mail.python.org/pipermail/python-ideas/2015-June/034177.html Since python's immutable ≠ really immutable, we now need a really

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-08 Thread felix
El 07/06/15 12:20, Rustom Mody escribió: On Saturday, June 6, 2015 at 10:20:49 AM UTC+5:30, Steven D'Aprano wrote: On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: On Saturday, June 6, 2015 at 3:30:23 AM UTC+5:30, Chris Angelico wrote: Congrats! You just proved that an object can itself be

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-07 Thread Chris Angelico
On Mon, Jun 8, 2015 at 2:20 AM, Rustom Mody rustompm...@gmail.com wrote: Ok now rewrite that para above with s/tuple/numbers like 3 or 666/ So I put '3' on the ram and grind it to finest powder. Have all trinities (of religious or secular variety) disappeared? 666 gone has the devil been

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-07 Thread Chris Angelico
On Mon, Jun 8, 2015 at 1:49 AM, Rustom Mody rustompm...@gmail.com wrote: On Saturday, June 6, 2015 at 11:13:52 AM UTC+5:30, Chris Angelico wrote: On Sat, Jun 6, 2015 at 3:28 PM, Rustom Mody wrote: You just repeated what Chris said, replacing 'immutable' with 'same' There was a list: [1,2,3]

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-07 Thread Rustom Mody
On Saturday, June 6, 2015 at 10:20:49 AM UTC+5:30, Steven D'Aprano wrote: On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: On Saturday, June 6, 2015 at 3:30:23 AM UTC+5:30, Chris Angelico wrote: Congrats! You just proved that an object can itself be immutable, but can contain references

Lawful != Mutable (was Can Python function return multiple data?)

2015-06-07 Thread Rustom Mody
On Saturday, June 6, 2015 at 11:13:52 AM UTC+5:30, Chris Angelico wrote: On Sat, Jun 6, 2015 at 3:28 PM, Rustom Mody wrote: You just repeated what Chris said, replacing 'immutable' with 'same' There was a list: [1,2,3] At some point that list is found to be(come) [1,2,3,4] They dont look

Re: Can Python function return multiple data?

2015-06-06 Thread Dave Farrance
Rustom Mody rustompm...@gmail.com wrote: On Saturday, June 6, 2015 at 10:20:49 AM UTC+5:30, Steven D'Aprano wrote: On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: As a parallel here is Dijkstra making fun of AI-ers use of the word 'intelligent'

Re: Can Python function return multiple data?

2015-06-06 Thread Amir Arsalan
you can use yield structure in python for multiple return. ex: def func(a): yield a*2 print a*2 yield a*3 print a*3 ... data = func(5) -- data = (10,15,... ) On Wed, Jun 3, 2015 at 1:57 AM, fl rxjw...@gmail.com wrote: Hi, I just see the tutorial says Python can return

Re: Can Python function return multiple data?

2015-06-06 Thread Amir Arsalan
yield structure can able to you that return list of return by nest in function. for example you want send a value as enter value to function and wanna after some calculate send value as return data. 2 way for this : a) send data as a list b) send data with yield example: a) def func(a):

Re: Can Python function return multiple data?

2015-06-06 Thread Steven D'Aprano
On Sun, 7 Jun 2015 03:57 am, fl wrote: Excuse me. I input the following according to your idea, but I do not understand how to use it from the echo. It does not show how to use the multiple output results. I am a new Python user. Please give a little more explanation if you could.

Re: Can Python function return multiple data?

2015-06-06 Thread Amir Arsalan
Tnx Steven, You are right completly.I try more subtilize thanks for your hint. On Sun, Jun 7, 2015 at 10:03 AM, Steven D'Aprano st...@pearwood.info wrote: Hi Amir, and welcome! On Sun, 7 Jun 2015 02:38 am, Amir Arsalan wrote: you can use yield structure in python for multiple return. ex:

Re: Can Python function return multiple data?

2015-06-06 Thread Steven D'Aprano
On Sat, 6 Jun 2015 03:32 pm, Rustom Mody wrote: On Saturday, June 6, 2015 at 10:20:49 AM UTC+5:30, Steven D'Aprano wrote: On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: As a parallel here is Dijkstra making fun of AI-ers use of the word 'intelligent'

Re: Can Python function return multiple data?

2015-06-06 Thread Steven D'Aprano
On Sat, 6 Jun 2015 03:28 pm, Rustom Mody wrote: There was a list: [1,2,3] At some point that list is found to be(come) [1,2,3,4] They dont look same to me. When you pour water into an empty bottle, does it turn into a different bottle? When you append items to a list (or remove them), it is

Re: Can Python function return multiple data?

2015-06-06 Thread Rustom Mody
On Saturday, June 6, 2015 at 11:27:29 PM UTC+5:30, fl wrote: On Saturday, June 6, 2015 at 9:39:19 AM UTC-7, Amir Arsalan wrote: you can use yield structure in python for multiple return. ex: def func(a):     yield a*2     print a*2     yield a*3     print a*3     ...

Re: Can Python function return multiple data?

2015-06-06 Thread Steven D'Aprano
Hi Amir, and welcome! On Sun, 7 Jun 2015 02:38 am, Amir Arsalan wrote: you can use yield structure in python for multiple return. ex: def func(a): yield a*2 print a*2 yield a*3 print a*3 ... data = func(5) -- data = (10,15,... ) That's actually wrong. If you run:

Re: Can Python function return multiple data?

2015-06-06 Thread fl
On Saturday, June 6, 2015 at 9:39:19 AM UTC-7, Amir Arsalan wrote: you can use yield structure in python for multiple return. ex: def func(a):     yield a*2     print a*2     yield a*3     print a*3     ... data = func(5) -- data = (10,15,... ) On Wed, Jun 3, 2015 at 1:57 AM,

Re: Can Python function return multiple data?

2015-06-05 Thread Marko Rauhamaa
Alain Ketterlin al...@universite-de-strasbourg.fr.invalid: Grant Edwards invalid@invalid.invalid writes: [...] Or to be a bit obtuse: Python parameters are passed by value, but all values are references. Exactly, that's a perfect description. There's is no need for a new name. As a

Re: Can Python function return multiple data?

2015-06-05 Thread Alain Ketterlin
Steven D'Aprano st...@pearwood.info writes: On Fri, 5 Jun 2015 04:17 am, Alain Ketterlin wrote: Steven D'Aprano st...@pearwood.info writes: [...] But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where

Re: Can Python function return multiple data?

2015-06-05 Thread Alain Ketterlin
Grant Edwards invalid@invalid.invalid writes: [...] Or to be a bit obtuse: Python parameters are passed by value, but all values are references. Exactly, that's a perfect description. There's is no need for a new name. As a corollary, all names (including variables and object attributes) are

Re: Can Python function return multiple data?

2015-06-05 Thread random832
On Thu, Jun 4, 2015, at 22:37, Steven D'Aprano wrote: That's not a reference to the value. That's a string that describes the object. Well, of course. None of these things are strings. The normal human-readable representation of a reference is an arrow on a diagram, pointing from a box that

Re: Can Python function return multiple data?

2015-06-05 Thread BartC
On 05/06/2015 02:48, Steven D'Aprano wrote: On Fri, 5 Jun 2015 11:40 am, Mark Lawrence wrote: On 05/06/2015 01:16, BartC wrote: On 05/06/2015 00:13, Steven D'Aprano wrote: On Fri, 5 Jun 2015 06:52 am, BartC wrote: On 04/06/2015 18:11, Steven D'Aprano wrote: If there is any language where

Re: Can Python function return multiple data?

2015-06-05 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@universite-de-strasbourg.fr.invalid: Grant Edwards invalid@invalid.invalid writes: [...] Or to be a bit obtuse: Python parameters are passed by value, but all values are references. Exactly, that's a perfect description.

Re: Can Python function return multiple data?

2015-06-05 Thread Steven D'Aprano
On Fri, 5 Jun 2015 01:16 pm, Rustom Mody wrote: Consider the C canonical linked-list example (of some type T): struct node { T elem; struct node *next; }; Is the list in C to be identified with 'struct node'? Lists in C are not first class values. There is no one thing which can

Re: Can Python function return multiple data?

2015-06-05 Thread Rustom Mody
On Friday, June 5, 2015 at 4:36:35 PM UTC+5:30, Steven D'Aprano wrote: On Fri, 5 Jun 2015 01:16 pm, Rustom Mody wrote: The abstract platonic immutable list is non-existent in python Just pretend that immutable list is spelled tuple. Ok lets say I make no fuss about the need to 'pretend'.

Re: Can Python function return multiple data?

2015-06-05 Thread Marko Rauhamaa
random...@fastmail.us: The normal human-readable representation of a reference is an arrow on a diagram, pointing from a box that represents the variable to a box that represents the object. But I can't exactly put that in a text-based email. An *lvalue* is anything that can be assigned to:

Re: Can Python function return multiple data?

2015-06-05 Thread sohcahtoa82
On Wednesday, June 3, 2015 at 2:57:00 PM UTC-7, Mark Lawrence wrote: On 03/06/2015 22:35, Chris Angelico wrote: On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 03.06.2015 um 01:56 schrieb Chris Angelico: and

Re: Can Python function return multiple data?

2015-06-05 Thread BartC
On 04/06/2015 15:37, Grant Edwards wrote: On 2015-06-04, Marko Rauhamaa ma...@pacujo.net wrote: Steven D'Aprano st...@pearwood.info: But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where the value is an

Re: Can Python function return multiple data?

2015-06-05 Thread Chris Angelico
On Fri, Jun 5, 2015 at 11:29 PM, Rustom Mody rustompm...@gmail.com wrote: On Friday, June 5, 2015 at 4:36:35 PM UTC+5:30, Steven D'Aprano wrote: On Fri, 5 Jun 2015 01:16 pm, Rustom Mody wrote: The abstract platonic immutable list is non-existent in python Just pretend that immutable list is

Re: Can Python function return multiple data?

2015-06-05 Thread Rustom Mody
On Saturday, June 6, 2015 at 8:58:13 AM UTC+5:30, rand...@fastmail.us wrote: On Fri, Jun 5, 2015, at 23:20, Rustom Mody wrote: The word immutuable happens to have existed in English before python. I also happen to have used it before I knew of python The two meanings do not match I am

Re: Can Python function return multiple data?

2015-06-05 Thread Chris Angelico
On Sat, Jun 6, 2015 at 3:28 PM, Rustom Mody rustompm...@gmail.com wrote: You just repeated what Chris said, replacing 'immutable' with 'same' There was a list: [1,2,3] At some point that list is found to be(come) [1,2,3,4] They dont look same to me. I'm going shopping, can you get me the

Re: Can Python function return multiple data?

2015-06-05 Thread Rustom Mody
On Saturday, June 6, 2015 at 10:20:49 AM UTC+5:30, Steven D'Aprano wrote: On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: As a parallel here is Dijkstra making fun of AI-ers use of the word 'intelligent' http://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/EWD618.html Nice rant,

Re: Can Python function return multiple data?

2015-06-05 Thread Chris Angelico
On Sat, Jun 6, 2015 at 2:50 PM, Steven D'Aprano st...@pearwood.info wrote: This does not happen: mylist = [] mytuple = (None, 1, mylist) mylist.append(0) = raises an exception The *tuple* is immutable, not the list. What you could have is a FrozenList (by analogy with

Re: Can Python function return multiple data?

2015-06-05 Thread Rustom Mody
On Saturday, June 6, 2015 at 3:30:23 AM UTC+5:30, Chris Angelico wrote: On Fri, Jun 5, 2015 at 11:29 PM, Rustom Mody wrote: On Friday, June 5, 2015 at 4:36:35 PM UTC+5:30, Steven D'Aprano wrote: On Fri, 5 Jun 2015 01:16 pm, Rustom Mody wrote: The abstract platonic immutable list is

Re: Can Python function return multiple data?

2015-06-05 Thread Chris Angelico
On Sat, Jun 6, 2015 at 1:28 PM, random...@fastmail.us wrote: On Fri, Jun 5, 2015, at 23:20, Rustom Mody wrote: The word immutuable happens to have existed in English before python. I also happen to have used it before I knew of python The two meanings do not match I am surprised Is that

Re: Can Python function return multiple data?

2015-06-05 Thread random832
On Fri, Jun 5, 2015, at 23:20, Rustom Mody wrote: The word immutuable happens to have existed in English before python. I also happen to have used it before I knew of python The two meanings do not match I am surprised Is that surprising? They don't match only if you consider the objects a

Re: Can Python function return multiple data?

2015-06-05 Thread Steven D'Aprano
On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: On Saturday, June 6, 2015 at 3:30:23 AM UTC+5:30, Chris Angelico wrote: Congrats! You just proved that an object can itself be immutable, but can contain references to mutables. Ain't that awesome? Did you have a point? [Under assumption

Re: Can Python function return multiple data?

2015-06-04 Thread Rustom Mody
On Friday, June 5, 2015 at 3:46:47 AM UTC+5:30, Steven D'Aprano wrote: On Fri, 5 Jun 2015 03:26 am, random832 wrote: If the value really were 23, the is vs == problem wouldn't exist. What problem? is versus == is not a problem, it is a feature. The two operators do two different things.

Re: Can Python function return multiple data?

2015-06-04 Thread Grant Edwards
On 2015-06-04, Steven D'Aprano st...@pearwood.info wrote: On Fri, 5 Jun 2015 04:38 am, Grant Edwards wrote: But, discussing pass-by-this vs. pass-by-that without also discussing the semantics of the assignment operator is rather pointless. No, that's a red-herring. I don't think so. ??The

Re: Can Python function return multiple data?

2015-06-04 Thread Rustom Mody
On Friday, June 5, 2015 at 8:07:41 AM UTC+5:30, Steven D'Aprano wrote: On Fri, 5 Jun 2015 08:59 am, random832 wrote: On Thu, Jun 4, 2015, at 18:16, Steven D'Aprano wrote: Remember, you've tried to claim that it is not invisible or unknown, so you must be able to see and know that value.

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 08:59 am, random...@fastmail.us wrote: On Thu, Jun 4, 2015, at 18:16, Steven D'Aprano wrote: Remember, you've tried to claim that it is not invisible or unknown, so you must be able to see and know that value. So what is the value? It doesn't have to have a string

Re: Can Python function return multiple data?

2015-06-04 Thread Mark Lawrence
On 05/06/2015 01:16, BartC wrote: On 05/06/2015 00:13, Steven D'Aprano wrote: On Fri, 5 Jun 2015 06:52 am, BartC wrote: On 04/06/2015 18:11, Steven D'Aprano wrote: If there is any language where assignment uses one style and argument passing always uses another, I've never come across it.

Re: Can Python function return multiple data?

2015-06-04 Thread BartC
On 05/06/2015 00:13, Steven D'Aprano wrote: On Fri, 5 Jun 2015 06:52 am, BartC wrote: On 04/06/2015 18:11, Steven D'Aprano wrote: If there is any language where assignment uses one style and argument passing always uses another, I've never come across it. My language does that. I'd be very

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 11:40 am, Mark Lawrence wrote: On 05/06/2015 01:16, BartC wrote: On 05/06/2015 00:13, Steven D'Aprano wrote: On Fri, 5 Jun 2015 06:52 am, BartC wrote: On 04/06/2015 18:11, Steven D'Aprano wrote: If there is any language where assignment uses one style and argument

Re: Can Python function return multiple data?

2015-06-04 Thread Chris Angelico
On Fri, Jun 5, 2015 at 3:11 AM, Steven D'Aprano st...@pearwood.info wrote: You need at least one more test to prove pass by value: you need to demonstrate that the value bound to y is copied when passed to the function. E.g. pass a mutable value (say, a list) and mutate it inside the function.

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 03:30 am, Marko Rauhamaa wrote: Steven D'Aprano st...@pearwood.info: On 2015-06-04, Marko Rauhamaa ma...@pacujo.net wrote: If it prints 1, it's pass by value. If it prints 3, it's pass by reference. Wrong. Why do you [Marko] imagine that pass-by-value and

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 04:38 am, Grant Edwards wrote: But, discussing pass-by-this vs. pass-by-that without also discussing the semantics of the assignment operator is rather pointless. No, that's a red-herring. I don't think so.  The reason that many people seem to confused about Python's

Re: Can Python function return multiple data?

2015-06-04 Thread random832
On Thu, Jun 4, 2015, at 18:16, Steven D'Aprano wrote: Remember, you've tried to claim that it is not invisible or unknown, so you must be able to see and know that value. So what is the value? It doesn't have to have a string representation to exist. But if you really want one?

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 06:52 am, BartC wrote: On 04/06/2015 18:11, Steven D'Aprano wrote: If there is any language where assignment uses one style and argument passing always uses another, I've never come across it. My language does that. I'd be very surprised if it was the only one in

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 03:26 am, random...@fastmail.us wrote: On Thu, Jun 4, 2015, at 09:47, Steven D'Aprano wrote: In other words, according to this Java philosophy, following `x = 23`, the value of x is not 23 like any sane person would expect, but some invisible and unknown, and unknowable,

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 03:30 am, random...@fastmail.us wrote: On Thu, Jun 4, 2015, at 13:11, Steven D'Aprano wrote: You need at least one more test to prove pass by value: you need to demonstrate that the value bound to y is copied when passed to the function. E.g. pass a mutable value (say, a

Re: Can Python function return multiple data?

2015-06-04 Thread BartC
On 04/06/2015 18:11, Steven D'Aprano wrote: If there is any language where assignment uses one style and argument passing always uses another, I've never come across it. My language does that. I'd be very surprised if it was the only one in existence that does so. Assignments involve a

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 04:17 am, Alain Ketterlin wrote: Steven D'Aprano st...@pearwood.info writes: [...] But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where the value is an implementation dependent

Re: Can Python function return multiple data?

2015-06-04 Thread Chris Angelico
On Fri, Jun 5, 2015 at 8:52 AM, Steven D'Aprano st...@pearwood.info wrote: On Fri, 5 Jun 2015 04:38 am, Grant Edwards wrote: But, discussing pass-by-this vs. pass-by-that without also discussing the semantics of the assignment operator is rather pointless. No, that's a red-herring. I don't

Re: Can Python function return multiple data?

2015-06-04 Thread random832
On Thu, Jun 4, 2015, at 09:47, Steven D'Aprano wrote: In other words, according to this Java philosophy, following `x = 23`, the value of x is not 23 like any sane person would expect, but some invisible and unknown, and unknowable, reference to 23. Well, no, because, in Java, if the type of

Re: Can Python function return multiple data?

2015-06-04 Thread Ian Kelly
On Wed, Jun 3, 2015 at 3:56 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Now does Python pass by value or by reference? Happily sits back and waits for 10**6 emails to arrive as this is discussed for the 10**6th time. Troll. -- https://mail.python.org/mailman/listinfo/python-list

Re: Can Python function return multiple data?

2015-06-04 Thread random832
On Thu, Jun 4, 2015, at 13:11, Steven D'Aprano wrote: You need at least one more test to prove pass by value: you need to demonstrate that the value bound to y is copied when passed to the function. E.g. pass a mutable value (say, a list) and mutate it inside the function. If the list in the

Re: Can Python function return multiple data?

2015-06-04 Thread Marko Rauhamaa
Steven D'Aprano st...@pearwood.info: On 2015-06-04, Marko Rauhamaa ma...@pacujo.net wrote: If it prints 1, it's pass by value. If it prints 3, it's pass by reference. Wrong. Why do you [Marko] imagine that pass-by-value and pass-by-reference are the only two options? It's a classic

Re: Can Python function return multiple data?

2015-06-04 Thread Grant Edwards
On 2015-06-04, Steven D'Aprano st...@pearwood.info wrote: On Fri, 5 Jun 2015 12:37 am, Grant Edwards wrote: On 2015-06-04, Marko Rauhamaa ma...@pacujo.net wrote: Anyway, I would say Python definitely is in the classic pass-by-value camp. Here's a simple test: def f(x): x = 3

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Fri, 5 Jun 2015 12:37 am, Grant Edwards wrote: On 2015-06-04, Marko Rauhamaa ma...@pacujo.net wrote: Anyway, I would say Python definitely is in the classic pass-by-value camp. Here's a simple test: def f(x): x = 3 y = 1 f(y) print(y) If it prints 1, it's pass

Re: Can Python function return multiple data?

2015-06-04 Thread Michael Torrie
On 06/04/2015 11:26 AM, random...@fastmail.us wrote: Of course, in CPython, the type of an object reference is PyObject *. Which isn't invisible, unknown, or unknowable, either. If the value really were 23, the is vs == problem wouldn't exist. Surely two objects can hold the same value, or

Re: Can Python function return multiple data?

2015-06-04 Thread random832
On Thu, Jun 4, 2015, at 13:36, Michael Torrie wrote: Surely two objects can hold the same value, or represent the same value (number), without *having* to be the same object. I don't see why people would assume, let alone demand that different objects representing the same value be the same

Re: Can Python function return multiple data?

2015-06-04 Thread Alain Ketterlin
Steven D'Aprano st...@pearwood.info writes: [...] But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where the value is an implementation dependent reference to the thing that you thought was the value. I

Re: Can Python function return multiple data?

2015-06-04 Thread ElChino
Steven D'Aprano wrote: But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where the value is an implementation dependent reference to the thing that you thought was the value. To quote Niklaus Wirth (the

Re: Can Python function return multiple data?

2015-06-04 Thread Grant Edwards
On 2015-06-04, Marko Rauhamaa ma...@pacujo.net wrote: Steven D'Aprano st...@pearwood.info: But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where the value is an implementation dependent reference to the

Re: Can Python function return multiple data?

2015-06-04 Thread Steven D'Aprano
On Thu, 4 Jun 2015 08:28 am, sohcahto...@gmail.com wrote: On Wednesday, June 3, 2015 at 2:57:00 PM UTC-7, Mark Lawrence wrote: [...] Now does Python pass by value or by reference? Happily sits back and waits for 10**6 emails to arrive as this is discussed for the 10**6th time. People

Re: Can Python function return multiple data?

2015-06-04 Thread Marko Rauhamaa
Grant Edwards invalid@invalid.invalid: Anyway, I would say Python definitely is in the classic pass-by-value camp. Here's a simple test: def f(x): x = 3 y = 1 f(y) print(y) If it prints 1, it's pass by value. If it prints 3, it's pass by reference. Somebody else

Re: Can Python function return multiple data?

2015-06-04 Thread Michael Torrie
On 06/03/2015 04:28 PM, sohcahto...@gmail.com wrote: People actually argue that Python passes by value? This is easily proven wrong by passing a mutable object to a function and changing it within the function. Sure but if you reassign the variable that was passed it, it has no effect

Re: Can Python function return multiple data?

2015-06-04 Thread Marko Rauhamaa
Steven D'Aprano st...@pearwood.info: But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where the value is an implementation dependent reference to the thing that you thought was the value. Why fight

Re: Can Python function return multiple data?

2015-06-04 Thread Serhiy Storchaka
On 03.06.15 02:56, Chris Angelico wrote: On Wed, Jun 3, 2015 at 7:27 AM, fl rxjw...@gmail.com wrote: I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return

Re: Can Python function return multiple data?

2015-06-04 Thread Mark Lawrence
On 04/06/2015 19:34, Ian Kelly wrote: On Wed, Jun 3, 2015 at 3:56 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: Now does Python pass by value or by reference? Happily sits back and waits for 10**6 emails to arrive as this is discussed for the 10**6th time. Troll. True indeed. As

Re: Can Python function return multiple data?

2015-06-03 Thread sohcahtoa82
On Wednesday, June 3, 2015 at 2:57:00 PM UTC-7, Mark Lawrence wrote: On 03/06/2015 22:35, Chris Angelico wrote: On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 03.06.2015 um 01:56 schrieb Chris Angelico: and

Re: Can Python function return multiple data?

2015-06-03 Thread Mark Lawrence
On 03/06/2015 22:35, Chris Angelico wrote: On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 03.06.2015 um 01:56 schrieb Chris Angelico: and it's pretty convenient. In C, the nearest equivalent is passing a number of

Re: Can Python function return multiple data?

2015-06-03 Thread Chris Angelico
On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 03.06.2015 um 01:56 schrieb Chris Angelico: and it's pretty convenient. In C, the nearest equivalent is passing a number of pointers as parameters, and having the

Re: Can Python function return multiple data?

2015-06-03 Thread Thomas Rachel
Am 03.06.2015 um 01:56 schrieb Chris Angelico: and it's pretty convenient. In C, the nearest equivalent is passing a number of pointers as parameters, and having the function fill out values. Python's model is a lot closer to what you're saying than C's model is :) At least, C functions can

Re: Can Python function return multiple data?

2015-06-03 Thread random832
On Wed, Jun 3, 2015, at 17:56, Mark Lawrence wrote: Now does Python pass by value or by reference? Happily sits back and waits for 10**6 emails to arrive as this is discussed for the 10**6th time. Python's in that same awkward space as Java, where it technically passes by value, but the

Re: Can Python function return multiple data?

2015-06-03 Thread Chris Angelico
On Thu, Jun 4, 2015 at 11:30 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Wed, 3 Jun 2015 15:28:56 -0700 (PDT), sohcahto...@gmail.com declaimed the following: People actually argue that Python passes by value? This is easily proven wrong by passing a mutable object to a function and

Re: Can Python function return multiple data?

2015-06-02 Thread Chris Angelico
On Wed, Jun 3, 2015 at 7:27 AM, fl rxjw...@gmail.com wrote: I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return requirement? Technically, neither C nor Python

Re: Can Python function return multiple data?

2015-06-02 Thread Joel Goldstick
On Tue, Jun 2, 2015 at 5:27 PM, fl rxjw...@gmail.com wrote: Hi, I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return requirement? Thanks, --

Re: Can Python function return multiple data?

2015-06-02 Thread John Gordon
In 3bbe49da-e989-4a8c-a8a9-75d3a786f...@googlegroups.com fl rxjw...@gmail.com writes: Hi, I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return requirement?

Re: Can Python function return multiple data?

2015-06-02 Thread sohcahtoa82
On Tuesday, June 2, 2015 at 2:27:37 PM UTC-7, fl wrote: Hi, I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return requirement? Thanks, You return a

Can Python function return multiple data?

2015-06-02 Thread fl
Hi, I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return requirement? Thanks, -- https://mail.python.org/mailman/listinfo/python-list