Mailing List Archive

Error Message: Can't assign to Operator
I keep hitting this error message:
SyntaxError: can't assign to operator(line 3056)

Line 3056 is
meta-previous = string.join( the_ultimate_file_destination_is_this, string_record_id, suffix )

the_ultimate_file_destination_is_this, string_record_id and suffix
are all defined elsewhere.

Questions:

Why does that construct not work?
How can I fix this construction?

If you want the entire script, it is available at
http://www.stamp-coin.com/python/script-error/index.html
<< Actually, that points you to the file that can be
downloaded. >>

xan

jonathon
Error Message: Can't assign to Operator [ In reply to ]
Jonathon wrote in message ...
>
> I keep hitting this error message:
> SyntaxError: can't assign to operator(line 3056)
>
> Line 3056 is
> meta-previous = string.join( the_ultimate_file_destination_is_this,
string_record_id, suffix )


The '-' character is not a legal part of an identifier. Try meta_previous or
something similar instead.

-tim
Error Message: Can't assign to Operator [ In reply to ]
[posted and e-mailed]

On Tue, 17 Aug 1999 21:41:01 +0000 (UTC), Jonathon
<jblake@stamp-coin.com> wrote:
>
> I keep hitting this error message:
> SyntaxError: can't assign to operator(line 3056)
>
> Line 3056 is
> meta-previous = string.join( the_ultimate_file_destination_is_this, string_record_id, suffix )
^
There's your problem. You can't include a '-' in the middle of a
name. Change 'meta-previous' to something like 'meta_previous'.

[snip]

> jonathon

Robert Kern |
----------------------|"In the fields of Hell where the grass grows high
This space | Are the graves of dreams allowed to die."
intentionally | - Richard Harter
left blank. |
Error Message: Can't assign to Operator [ In reply to ]
Jonathon <jblake@stamp-coin.com> wrote:

: I keep hitting this error message:
: SyntaxError: can't assign to operator(line 3056)
:
: Line 3056 is
: meta-previous = string.join( the_ultimate_file_destination_is_this, string_record_id, suffix )
:
: the_ultimate_file_destination_is_this, string_record_id and suffix
: are all defined elsewhere.

: Questions:

: Why does that construct not work?
: How can I fix this construction?

It is probably because "meta-previous" is parsed as "meta" "-" "previous"
a subtraction expression. Change the minus ("-") to an underscore ("_")
and it should work better. I've done this. :)

-Arcege