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
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
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
[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)
finallist.
[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 inpu
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
t
http://effbot.org/zone/python-objects.htm still says it best.
mt
--
http://mail.python.org/mailman/listinfo/python-list
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
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 t
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
[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 u
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 these
12 matches
Mail list logo