simple threading.Thread and Semaphores hang

2010-12-06 Thread lnenov
Hi, My application hangs on exit. I have isoleted this piece of code that reproduces the error: (the time module is extra and not needed to reproduce) import threading import time def func(): b = threading.Semaphore(value=0) b.acquire() a = threading.Thread(target=func) a.start() ti

Re: Enumeration of strings and export of the constants

2010-11-11 Thread lnenov
On 11/10/2010 11:19 PM, Emile van Sebille wrote: On 11/10/2010 5:12 AM lnenov said... Hi, I need to enumerate a couple hundred strings to constants and export them to another module(s) globals. Do they really need to be globals? Why not a constants in an object/container that would neither

Re: Enumeration of strings and export of the constants

2010-11-11 Thread lnenov
On 11/11/2010 01:30 AM, Ian wrote: On Nov 10, 6:12 am, lnenov wrote: Is there a better and more common way to do this? from itertools import count, izip class APINamespace(object): def __init__(self): self._named_values = [] def enumerate(self, names, start=0, step=1

Enumeration of strings and export of the constants

2010-11-10 Thread lnenov
Hi, I need to enumerate a couple hundred strings to constants and export them to another module(s) globals. In the mean time I want to keep my module's namespace as clear as I can and I don't want to use "import *" later. Here is the code I intend to use: test.py 1 class Apinamespace()