strange error when trying to log something

2009-07-23 Thread Ryszard Szopa
work normally) by making UserDict.UserDict inherit from object. Any ideas what is causing the error? Before I updated Python everything was fine. Am I breaking a lot of things by making UserDict.UserDict a new style class? Thanks in advance for any insight. -- Ryszard Szopa -- http://mail.python.org/mailman/listinfo/python-list

Re: Turn off ZeroDivisionError?

2008-02-09 Thread Ryszard Szopa
On Feb 9, 11:03 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > I'd like to turn off ZeroDivisionError. I'd like 0./0. to just give NaN, > and when output, just print 'NaN'. I notice fpconst has the required > constants. I don't want to significantly slow floating point math, so I > don't want to j

Re: Why not a Python compiler?

2008-02-08 Thread Ryszard Szopa
On Feb 8, 12:25 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Be fair -- he's asking what specific features of Python make it > > hard. That's a reasonable question. > > Indeed. The best explanation I've seen explained goes something like > this: i

Re: Why not a Python compiler?

2008-02-07 Thread Ryszard Szopa
On Feb 5, 9:30 am, [EMAIL PROTECTED] wrote: > I don't know the exact details but I think the issue is the dynamic > nature of Python makes it impossible to correctly store the various > types and changes into compiled code. Someone else will probably be > able to provide a good reason as to why it

Re: Dictionary Keys question

2008-01-30 Thread Ryszard Szopa
On Jan 31, 12:08 am, Dustan <[EMAIL PROTECTED]> wrote: > The underlying order is a result, in part, of the key's hash codes*. > Integers are hash coded by their integer values, therefore, they > appear in numeric order. Strings, however, use an algorithm that > ensures as unique hash codes as poss

booleans, hash() and objects having the same value

2008-01-30 Thread Ryszard Szopa
Hi all, I've just read PEP 285 so I understand why bool inherits from int and why, for example, ((False - True)*True)**False==1. This was necessary for backwards compatibility and to give the beast some ability to do moral reasoning. For example, Python knows to value the whole truth more than ju

Re: writing Python in Emacs

2008-01-30 Thread Ryszard Szopa
Thanks Rob. Your code should basically do the trick. -- Richard -- http://mail.python.org/mailman/listinfo/python-list