neoedmund a écrit :
On Sep 7, 4:07 pm, gu [EMAIL PROTECTED] wrote:
(snip pb and code)
now, in the second for cycle and in functionA() i only 'touch' copyOfA
(altering it). as i don't touch the variable a, i expect it not to be
affected by any change, but copyOfA acts like a pointer to a and
En Wed, 12 Sep 2007 08:30:14 -0300, Bruno Desthuilliers
[EMAIL PROTECTED] escribi�:
neoedmund a écrit :
On Sep 7, 4:07 pm, gu [EMAIL PROTECTED] wrote:
(snip pb and code)
now, in the second for cycle and in functionA() i only 'touch'
copyOfA
(altering it). as i don't touch the variable
Am Sat, 08 Sep 2007 09:44:24 + schrieb Steven D'Aprano:
Ways that Python objects are not like C pointers:
(1) You don't have to manage memory yourself.
(2) You don't have typecasts. You can't change the type of the object you
point to.
(3) Python makes no promises about the memory
On Sep 7, 4:07 pm, gu [EMAIL PROTECTED] wrote:
hi to all!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of course! i've stripped down the
code to reproduce the
On Sep 8, 10:44 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
[...]
Ways that Python objects are like pointers:
(1) ... um...
Oh yeah, if you bind the _same_ object to two different names, _and_ the
object is mutable (but not if it is immutable), mutating the object via
On Sun, 09 Sep 2007 02:30:00 -0700, Arnaud Delobelle wrote:
You know, maybe because I came to Python with no C experience, I never
had trouble with the unexpected behaviour that so confused the
original poster. It's just obvious.
The funny thing is that if the OP had thought of both 'a' and
On Sep 9, 1:59 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Sun, 09 Sep 2007 02:30:00 -0700, Arnaud Delobelle wrote:
You know, maybe because I came to Python with no C experience, I never
had trouble with the unexpected behaviour that so confused the
original poster.
Arnaud Delobelle [EMAIL PROTECTED] wrote:
...
def lower_list(L):
... for i, x in enumerate(L):
... L[i] = x.lower()
... s = ['STRING']
lower_list(s)
print s == ['string']
True
def lower_string(s):
... s = s.lower()
... s = STRING
lower_string(s)
Am Sat, 08 Sep 2007 00:32:35 + schrieb Steven D'Aprano:
On Fri, 07 Sep 2007 15:59:53 +0200, Wildemar Wildenburger wrote:
I just thought I'd go along with the analogy the OP created as that was
his mindset and it would make things easier to follow if I didn't try to
forcibly change that.
Am Fri, 07 Sep 2007 13:10:16 + schrieb Grant Edwards:
On 2007-09-07, Peter Otten [EMAIL PROTECTED] wrote:
Am Fri, 07 Sep 2007 10:40:47 + schrieb Steven D'Aprano:
Python doesn't have any pointers.
Thinking of python variables or names as pointers should
get you a long way when
On Sat, 08 Sep 2007 10:07:14 +0200, Peter Otten wrote:
Am Fri, 07 Sep 2007 13:10:16 + schrieb Grant Edwards:
On 2007-09-07, Peter Otten [EMAIL PROTECTED] wrote:
Am Fri, 07 Sep 2007 10:40:47 + schrieb Steven D'Aprano:
Python doesn't have any pointers.
Thinking of python variables
Dennis Lee Bieber wrote:
On Fri, 07 Sep 2007 12:19:12 -0700, Steve Holden [EMAIL PROTECTED]
declaimed the following in comp.lang.python:
Since it's only a matter of time before someone brings up the post-It
analogy, let me cavil in advance about it. The thing I don't like about
that
gu wrote:
hi to all!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of course! i've stripped down the
code to reproduce the problem:
[snip FAQ]
Yes, basically
gu schreef:
copyOfA = a
now, in the second for cycle and in functionA() i only 'touch' copyOfA
(altering it).
copyOfA isn't a copy of a; it's a different name bound to the same
object as a. You can verify that: id(a) and id(copyOfA) will return the
same value.
To make a copy of a
On Fri, 07 Sep 2007 10:40:47 +, Steven D'Aprano wrote:
Nor does it include peek and poke commands for reading and writing
into random memory locations.
I guess `ctypes` offers tools to write `peek()` and `poke()`. :-)
Ciao,
Marc 'BlackJack' Rintsch
--
On 2007-09-07, Peter Otten [EMAIL PROTECTED] wrote:
Am Fri, 07 Sep 2007 10:40:47 + schrieb Steven D'Aprano:
Python doesn't have any pointers.
Thinking of python variables or names as pointers should
get you a long way when trying to understand python's behaviour.
But thinking of them as
Am Fri, 07 Sep 2007 10:40:47 + schrieb Steven D'Aprano:
Python doesn't have any pointers.
Thinking of python variables or names as pointers should
get you a long way when trying to understand python's behaviour.
As long as you keep in mind that python doesn't have pointers to pointers,
and
On Fri, 07 Sep 2007 11:46:38 +0200, Wildemar Wildenburger wrote:
gu wrote:
hi to all!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of course! i've stripped down the
On Sep 7, 3:07 am, gu [EMAIL PROTECTED] wrote:
hi to all!
Hi!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of course! i've stripped down the
code to reproduce the
hi to all!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of course! i've stripped down the
code to reproduce the problem:
code
a = {}
for x in range(10):
for y
Steven D'Aprano wrote:
On Fri, 07 Sep 2007 11:46:38 +0200, Wildemar Wildenburger wrote:
gu wrote:
hi to all!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of
En Fri, 07 Sep 2007 05:07:03 -0300, gu [EMAIL PROTECTED] escribi�:
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of course! i've stripped down the
code to reproduce
Steven D'Aprano wrote:
On Fri, 07 Sep 2007 11:46:38 +0200, Wildemar Wildenburger wrote:
gu wrote:
hi to all!
after two days debugging my code, i've come to the point that the
problem was caused by an unexpected behaviour of python. or by lack of
some information about the program, of
Grant Edwards wrote:
On 2007-09-07, Peter Otten [EMAIL PROTECTED] wrote:
Am Fri, 07 Sep 2007 10:40:47 + schrieb Steven D'Aprano:
Python doesn't have any pointers.
Thinking of python variables or names as pointers should
get you a long way when trying to understand python's behaviour.
On Fri, 07 Sep 2007 15:59:53 +0200, Wildemar Wildenburger wrote:
I just thought I'd go along with the analogy the OP created as that was
his mindset and it would make things easier to follow if I didn't try to
forcibly change that.
My reaction to somebody trying to reason with the wrong
25 matches
Mail list logo