Re: Why TypeError: 'str' object is not callable?

2006-03-22 Thread Randall Parker
Argh! I do not know what happened to the percent signs. They used to be there. Sorry to waste the time of so many people. -- http://mail.python.org/mailman/listinfo/python-list

Why TypeError: 'str' object is not callable?

2006-03-22 Thread Randall Parker
Using Python 2.4.2 on Windows 2000 in SPE. Getting: TypeError: 'str' object is not callable on this line: TmpErrMsg1 = "State machine %s " (StateMachineName) In Winpdb 1.0.6 the StateMachineName is of type str in the Namespace | Local window of local variables. It even has the string value I ex

TypeError coercing to Unicode with field read from XML file

2006-03-21 Thread Randall Parker
Running Python 2.4.2 on Windows in SPE. I have a very small XML file (see below) that is in UTF-8 and saved by Windows Notepad as such. I'm reading it with minidom. My problem is that once I parse the file with minidom and a field from it to another variable as shown with this line: IP

Re: Python vs C for a mail server

2006-02-02 Thread Randall Parker
Magnus Lycka wrote: > Or...don't you have automated tests? Ouch. If you (like me) feel a > little lazy to write a lot of test scripts, you can use a test tool > such as TextTest, that compares output between test runs, rather than > forcing you to write lots of scripts with plenty of assertions.

Re: Python vs C for a mail server

2006-02-01 Thread Randall Parker
Donn, More generally: One must keep in mind that advantages and disadvantages of specific implementations of language concepts are not always indications of flaws in those concepts. Real languages have real flaws from bad design choices which cause them to fall short of what those languages could

Re: Python vs C for a mail server

2006-02-01 Thread Randall Parker
Magnus Lycka wrote: > Randall Parker wrote: > > Also, compile time errors get caught sooner. They get caught before > > tests even get written. > > Not if you do Test Driven Tevelopment. Then you write > the tests before you compile your target code! It's > also m

Re: Python vs C for a mail server

2006-01-31 Thread Randall Parker
But languages that share some weakness typically do not share it equally. Three languages can have some way to do X (which some might find undesirable while others find it great) but two of the languages might make it easy to solve problems without ever doing X while the third language might make i

Re: Python vs C for a mail server

2006-01-31 Thread Randall Parker
Jay, The point of doing compile time and test time checking is the same reason militaries use layered defenses: More problems get caught. I've written tons of software tests and architected a testing system for an entire aircraft. I've also watched lots of errors get by tests. Also, compile time

Re: Python vs C for a mail server

2006-01-31 Thread Randall Parker
Alex Martelli wrote: > The "but without declaration it can't be self-documenting" issue is a > red herring. Reading, e.g.: > > int zappolop(int frep) { ... > > gives me no _useful_ "self-documenting" information about the role and > meaning of frep, or zappolop's result. The code's author must o

Re: MyHDL 0.5 released

2006-01-20 Thread Randall Parker
Jan, What do you see as the main advantage for using MyHDL rather than VHDL for coding up a chip design? -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Introduction to Event-Driven Programming

2006-01-20 Thread Randall Parker
Steve, This is an aside: I'd love to see someone implement in Python a framework similar to the Quantum Leaps Quantum Framework for event-driven programming. I think Python has some features that lend themselves to a neater implementation than what can be done in C/C++. More generally, I'd like t

Conditionals stored as text to translate to real compares

2006-01-13 Thread Randall Parker
I want to know if there is some way to translate fragments of text into operators (e.g. <, >, <>, ==, etc) to use in conditional expressions. I've got a data structure which is a list of lists. A single list might look like: MyInnerList = ["MyVar",">",7] or MySecondInnerList = ["MyOtherVar","<=",