Using assingment as an operator.
sholden at holdenweb.com
Fri Oct 12 15:23:20 CEST 2001
"Emil S. Hansen" <esh at berlingske.dk> wrote ...
> Hello fellow PP.
> I have a simple question. In a program I have a statement like this:
> while re.search("[^a-z0-9.]", domainname = raw_input("Please enter
domainname: ")) != None:
> print "Error in domainname, please use lovercase letters and
> When I run the program I get a
> "TypeError: unexpected keyword argument: domainname",
> how can I use an assigment as an operator for a function?
You can't. See Frequently Asked Question 6.30 for why. The syntax you use is
for keyword arguments to functions, another subject entirely.
can be called using
and you can explicity declare an argument as a keyword argument with a
default value. I only mention all this to explain the apprently bizarre
More information about the Python-list