Re: Using modules from Debian "python3-..." packages with locally compiled Python 3.3

2012-05-08 Thread Edward C. Jones
Terry Reedy said: > Question 1: if you use the .pth method, do you get the same result? (I expect you will, but good to > check.) Recompiled Pyhton 3.3 without the SITEPATH change. Same result: > python3.3 Python 3.3.0a3 (default, May 8 2012, 19:57:45) [GCC 4.6.3] on linux Type "help", "cop

Re: Using modules from Debian "python3-..." packages with locally compiled Python 3.3

2012-05-08 Thread Terry Reedy
On 5/8/2012 3:13 PM, Edward C. Jones wrote: I use up-to-date Debian testing (wheezy), amd64 architecture. I downloaded, compiled and installed Python 3.3.0 alpha 3 (from python.org) using "altinstall". Debian wheezy comes with python3.2 (and 2.6 and 2.7). I installed the Debian package "python3-b

Re: using modules

2010-09-06 Thread Terry Reedy
On 9/6/2010 12:55 PM, Sal Lopez wrote: The following code runs OK under 3.1: @filename=cats_and_dogs.py #!/usr/bin/python def make_sound(animal): print(animal + ' says ' + sounds[animal]) sounds = { "cat": "meow", "dog": "woof" } for i in sounds.keys(): make_sound(i) # output: # d

Re: using modules

2010-09-06 Thread Richard Thomas
On Sep 6, 5:55 pm, Sal Lopez wrote: > The following code runs OK under 3.1: > > @filename=cats_and_dogs.py > > #!/usr/bin/python > > def make_sound(animal): >     print(animal + ' says ' + sounds[animal]) > > sounds = { "cat": "meow", "dog": "woof" } > > for i in sounds.keys(): >     make_sound(i)

Re: using modules in destructors

2008-10-28 Thread MRAB
On Oct 27, 5:40 pm, Scott David Daniels <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > It seems to me that deleting local instances before imported modules > > would solve the problem. Is it not possible for the interpreter to get > > this right? Or are there cases where this would break

Re: using modules in destructors

2008-10-27 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: It seems to me that deleting local instances before imported modules would solve the problem. Is it not possible for the interpreter to get this right? Or are there cases where this would break stuff. It seems rather unpythonic for the __del__() method to become unpredic

Re: using modules in destructors

2008-10-25 Thread [EMAIL PROTECTED]
It seems to me that deleting local instances before imported modules would solve the problem. Is it not possible for the interpreter to get this right? Or are there cases where this would break stuff. It seems rather unpythonic for the __del__() method to become unpredictable at exit. -- http://ma

Re: using modules in destructors

2008-10-24 Thread Michele Simionato
This is expected behavior (see http://www.python.org/doc/essays/cleanup) but it is definitely a wart of Python. The best advice I can give you is *never* use __del__. There are alternatives, such as the with statement, weak references or atexit. See for instance http://code.activestate.com/recipes