Re: Events: The Python Way

2007-07-28 Thread Antti Rasinen
exception if x is not in the set, discard does not. -- [ [EMAIL PROTECTED] <*> Antti Rasinen ] "The music of rebellion makes you wanna rage But it's made by millionaires who are nearly twice your age" -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting __future__ features

2007-07-30 Thread Antti Rasinen
quot;Bingo! Two in a row!" Check the __future__ docstrings for more information. -- [ [EMAIL PROTECTED] <*> Antti Rasinen ] This drone-vessel speaks with the voice and authority of the Ur-Quan. -- http://mail.python.org/mailman/listinfo/python-list

Re: removing redundant elements in a dictionary

2007-08-01 Thread Antti Rasinen
However, here is a very quick version that works in my tests: for out_list in elem.values(): out_list.sort() for out1 in elem.keys(): for out2 in elem.keys(): if out1 != out2 and elem[out1] == elem[out2]: del elem[out1] break There are probably several ways to improve on that, however. -- [ [EMAIL PROTECTED] <*> Antti Rasinen ] "Pay the man his wage, he's making paper to fuel the Information Age." -- http://mail.python.org/mailman/listinfo/python-list

Re: Use variable in regular expression

2007-08-02 Thread Antti Rasinen
#x27;^%s' % yesterday_date # I'm assuming yesterday_date is a string. re.compile(search_str) *) http://docs.python.org/lib/typesseq-strings.html -- [ [EMAIL PROTECTED] <*> Antti Rasinen ] This drone-vessel speaks with the voice and authority of the Ur-Quan. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about properties.

2007-08-10 Thread Antti Rasinen
e name of the variable name to y, you'd have hidden_x.y == -5 instead of 4. The example is very contrived. There might be some security related cases where you need to hide what you store in memory, though. (Hopefully they do more than just invert the bits! :) NB: I don't know what