Re: passing class by reference does not work??

2007-04-11 Thread antred
> def b(item, a): > a.val = a.val + 1 > return item + a.val This is where the problem lies, specifically the line a.val = a.val + 1 What happens here is that the 1st a.val refers to a member of the class instance a, called val ... which does not yet exist and is therefore creat

Re: Python email parser

2007-01-25 Thread antred
Hmm, I'm not sure whether I'd call 30 secs for 110 MB particularly slow. I mean that *IS* a lot of data. -- http://mail.python.org/mailman/listinfo/python-list

Please have a look at this class

2007-01-25 Thread antred
Hello everyone, While working on a program I encountered a situation where I'd construct a largish data structure (a tree) from parsing a host of files and would end up having to throw away parts of my newly built tree if a file turned out to contain invalid data. My first thought was 'Well, you c

Re: Am I stupid or is 'assert' broken in Python 2.5??

2006-12-06 Thread antred
Yeah, it hit me seconds after I had posted my message. =0 Why didn't I think of it during the 30 minutes I spent banging my head against the keyboard going nuts over this 'bug' ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I stupid or is 'assert' broken in Python 2.5??

2006-12-06 Thread antred
Never mind, I'm a schmuck!! =0 It should have been assert myString, 'String empty or None!' Sorry, ignore me. =\ -- http://mail.python.org/mailman/listinfo/python-list

Am I stupid or is 'assert' broken in Python 2.5??

2006-12-06 Thread antred
I've noticed something odd in Python 2.5, namely that the 2 argument version of 'assert' is broken. Or at least it seems that way to me. Run the following code in your Python interpreter: myString = None assert( myString, 'The string is either empty or set to the None type!' ) assert( myString )

Re: Threads

2006-05-12 Thread antred
Aww shoot, I never knew that!! LOL, I implemented my own worker thread class using a mutex protected job list and a pair of connected sockets for interprocess communication when I could just have used the darn Queue module instead. Gr hehe. -- http://mail.python.org/mailman/listinfo/pyth

Re: threads/sockets quick question.

2005-09-19 Thread antred
maybe try this while threading.activeCount() < MAX_THREADS: # instead of while threading < MAX_THREADS: -- http://mail.python.org/mailman/listinfo/python-list

Re: threads/sockets quick question.

2005-09-19 Thread antred
Ah shoot, never mind, I'm an idiot. =0 -- http://mail.python.org/mailman/listinfo/python-list

Re: threads/sockets quick question.

2005-09-19 Thread antred
This may be a really stupid question, but are you actually CALLING your scan() function anywhere? -- http://mail.python.org/mailman/listinfo/python-list