Ben wrote:
(OT : Ben, please stop top-posting, it's really annoying)0
> Ah - I found out why I had cast it to a string.
cf my previous anwser on this point.
> I had not, at that
> point, worked out ho to pass the list by value rather than reference,
There's nothing like 'pass by value/pass by r
Ben wrote:
> Using Fredericks advice I managed to track down the problem - it was
> really very stupid. I had accidentally cast the list to a string
There's nothing like "type casting" in Python. You did not "cast the
list to a string", you created a string from a list.
--
bruno desthuilliers
py
Ben wrote:
> Ah... my list is a string. That explains the len() results, but not why
> it is a string in the dirst place.
>
> I have a dictionary containing a number of instances of the following
> class as values:
>
> class panel:
> mops =[]
This one is a class attribute - it's shared betwe
Ben wrote:
> Ah - I found out why I had cast it to a string. I had not, at that
> point, worked out ho to pass the list by value rather than reference,
> and so was casting to a string as a stopgap measure that I then forgot
> about. Now the problem is fixed after this group told me how to pass a
Ben wrote:
> Ah - I found out why I had cast it to a string. I had not, at that
> point, worked out ho to pass the list by value rather than reference,
> and so was casting to a string as a stopgap measure that I then forgot
> about. Now the problem is fixed after this group told me how to pass a
Ah - I found out why I had cast it to a string. I had not, at that
point, worked out ho to pass the list by value rather than reference,
and so was casting to a string as a stopgap measure that I then forgot
about. Now the problem is fixed after this group told me how to pass a
list by value (by sl
Theerasak Photha wrote:
> On 8 Oct 2006 06:12:48 -0700, John Machin <[EMAIL PROTECTED]> wrote:
>
> >
> > Show us the code that is creating instances of the panel class ...
> >
> > panel1 =
> > panel(number=?,level=?,location=?,mops=,matrix=?)
> > What are you passing as the 4th pos
On 8 Oct 2006 06:12:48 -0700, John Machin <[EMAIL PROTECTED]> wrote:
>
> Show us the code that is creating instances of the panel class ...
>
> panel1 =
> panel(number=?,level=?,location=?,mops=,matrix=?)
> What are you passing as the 4th positional arg
> ^^^ ??
Using Fredericks advice I managed to track down the problem - it was
really very stupid. I had accidentally cast the list to a string
earlier in another part of the code. Its a bit of an anticlimax really
- not mysterious at all (just mysteriously remiss on my part)
Apologies for not simple postin
Ben wrote:
> ...and when I print out the string, it is still formatted as one would
> expect a list to be:
>
> "['01', '02', '03', '04']"
>
We know that. Fredrik deduced it and told you well over an hour ago.
Show us the code that is creating instances of the panel class ...
panel1 =
panel(num
Thanks for the advice - I'm already doing just that, so hopefully will
soon be sorted :-p
John Machin wrote:
> Ben wrote:
> > Ah... my list is a string. That explains the len() results, but not why
> > it is a string in the dirst place.
> >
> > I have a dictionary containing a number of instance
Ben wrote:
> Ah... my list is a string. That explains the len() results, but not why
> it is a string in the dirst place.
>
> I have a dictionary containing a number of instances of the following
> class as values:
>
> class panel:
> mops =[]
>
> def __init__(self,number,level,location,mop
Ben wrote:
> Ah... my list is a string. That explains the len() results, but not why
> it is a string in the dirst place.
>
> I have a dictionary containing a number of instances of the following
> class as values:
>
> class panel:
> mops =[]
>
> def __init__(self,number,level,location,mop
...and when I print out the string, it is still formatted as one would
expect a list to be:
"['01', '02', '03', '04']"
Ben wrote:
> Ah... my list is a string. That explains the len() results, but not why
> it is a string in the dirst place.
>
> I have a dictionary containing a number of instan
Ah... my list is a string. That explains the len() results, but not why
it is a string in the dirst place.
I have a dictionary containing a number of instances of the following
class as values:
class panel:
mops =[]
def __init__(self,number,level,location,mops,matrix):
self.numb
Ben wrote:
> The output from this would be (for a given key value):
> Number: 181
> Level:ovride+supvis
> Location: mons=4 v8.0 3rd floor
> MOPS: ['287', '288', '289', '290']
> List Length: 28
>
16 matches
Mail list logo