On Apr 15, 3:51 pm, sturlamolden [EMAIL PROTECTED] wrote:
On Apr 15, 8:19 pm, [EMAIL PROTECTED] wrote:
Coming from VBA I have a tendency to think of everything as an
array...
Coding to much in Visual Basic, like Fortran 77, is bad for your mind.
The distinction you're looking for is:
VB:
As a relative new comer to Python, I haven't done a heck of a lot of
hacking around with it. I had my first run in with Python's quirky (to
me at least) tendency to assign by reference rather than by value (I'm
coming from a VBA world so that's the terminology I'm using). I was
surprised that
[EMAIL PROTECTED] wrote:
As a relative new comer to Python, I haven't done a heck of a lot of
hacking around with it. I had my first run in with Python's quirky (to
me at least) tendency to assign by reference rather than by value (I'm
coming from a VBA world so that's the terminology I'm
On Apr 15, 10:23 am, [EMAIL PROTECTED] wrote:
As a relative new comer to Python, I haven't done a heck of a lot of
hacking around with it. I had my first run in with Python's quirky (to
me at least) tendency to assign by reference rather than by value (I'm
coming from a VBA world so that's the
On Apr 15, 6:23 pm, [EMAIL PROTECTED] wrote:
As a relative new comer to Python, I haven't done a heck of a lot of
hacking around with it. I had my first run in with Python's quirky (to
me at least) tendency to assign by reference rather than by value (I'm
coming from a VBA world so that's the
Thank you both, the assigning using slicing works perfectly (as I'm
sure you knew it would)... It just didn't occur to me because it
seemed a little nonintuitive... The specific application was
def dicttolist (inputdict):
finallist=[]
for k, v in inputdict.iteritems():
temp = v
http://effbot.org/zone/python-objects.htm still says it best.
mt
--
http://mail.python.org/mailman/listinfo/python-list
I think the fundamental disconnect is this issue of mutability and
immutability that people talk about (mainly regarding tuples and
whether they should be thought of as static lists or not)
Coming from VBA I have a tendency to think of everything as an
array...
So when I create the following
[EMAIL PROTECTED] wrote:
Thank you both, the assigning using slicing works perfectly (as I'm
sure you knew it would)... It just didn't occur to me because it
seemed a little nonintuitive... The specific application was
def dicttolist (inputdict):
finallist=[]
for k, v in
[EMAIL PROTECTED] schrieb:
by changing temp = v[:] the code worked perfectly (although changing
temp.insert(0,k) to temp = [k] + temp also worked fine... I didn't
like that as I knew it was a workaround)
So the for body now looks like this?:
temp = v[:]
temp.insert(0, k)
On Apr 15, 7:23 pm, [EMAIL PROTECTED] wrote:
test = [[1],[2]]
x = test[0]
Python names are pointer to values. Python behaves like Lisp - not
like Visual Basic or C#.
Here you make x point to the object which is currently pointed to by
the first element in the list test. If you now reassign
On Apr 15, 8:19 pm, [EMAIL PROTECTED] wrote:
Coming from VBA I have a tendency to think of everything as an
array...
Coding to much in Visual Basic, like Fortran 77, is bad for your mind.
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo