Re: No ValueError for large exponents?

2006-09-10 Thread enigmadude
Georg Brandl wrote: > enigmadude wrote: > > As many have heard, IronPython 1.0 was released. When I was looking > > through the listed differences between CPython and IronPython, the > > document mentioned that using large exponents such as 10 ** > > 735293857239475

No ValueError for large exponents?

2006-09-06 Thread enigmadude
As many have heard, IronPython 1.0 was released. When I was looking through the listed differences between CPython and IronPython, the document mentioned that using large exponents such as 10 ** 735293857239475 will cause CPython to hang, whereas IronPython will raise a ValueError. Trying this on m

Re: trouble understanding inheritance...

2006-08-17 Thread enigmadude
If what you're trying to do is have more control over the type of object that is instantiated, then you could use a function that decides what class to use based upon the arguments supplied to the function, where it then instantiates an object from the chosen class, then returns the object. The __i

Re: hide python code !

2006-08-16 Thread enigmadude
sort function. Geez. Just keep the sources open people. Slawomir Nowaczyk wrote: > On Thu, 10 Aug 2006 17:35:27 -0700 > enigmadude <[EMAIL PROTECTED]> wrote: > > #> 2. I've never done this, but you might be able to encrypt or otherwise > #> turn you modules into binary

Re: hide python code !

2006-08-10 Thread enigmadude
I don't think you're the first person that has wondered about this. But you might have some options: 1. If you are running it on Windows only, use py2exe to wrap it up as an executable. 2. I've never done this, but you might be able to encrypt or otherwise turn you modules into binary form, and th

Re: Nested function scope problem

2006-08-09 Thread enigmadude
I agree with the previous comments that this approach is "bad form". But if you absolutely *must* modify an enclosing function's variables with an inner function, all you need to do is remember that a Python function is an object too, so it can be assigned attributes. ;-) def outer(): outer.x

Re: Python share CPU time?

2006-08-09 Thread enigmadude
There's several ways of doing concurrency in Python. Other than the threading module, have you tried FibraNet? It's designed with simple games in mind. You can download it at http://cheeseshop.python.org/pypi/FibraNet. Specifically the nanothreads module from FibraNet uses generators to simulate li

Re: __contains__ vs. __getitem__

2006-08-09 Thread enigmadude
That's a vague question, so the obligatory "it depends" response applies here. If you want to guard against the unexpected, perhaps it's a good idea to write unit tests rather than to take someone's word that it *should* work okay every time, in every case, no matter what you're doing with the dat

Re: using python with tar files and compressed files

2006-08-09 Thread enigmadude
This syntax works on other bzipped tar files. But it's not unheard of that large tarballs will get corrupted from a download mirror. Use a download manager and try redownloading the file. Usually a mirror will include an md5sum text file so that you can compare the checksum to your downloaded file