Re: unique elements from list of lists

2007-02-09 Thread Tekkaman
Thanks everybody! Azrael: your suggestions involve python-level membership testing and dummy list construction just like my uniter3 example, so I'm afraid they would not go any faster. There's no built-in sequence flattening function that I know of btw. bearophile: your implementation is very simil

unique elements from list of lists

2007-02-09 Thread Tekkaman
I have a list of lists and I want to define an iterator (let's call that uniter) over all unique elements, in any order. For example, calling: sorted(uniter([['a', 'b', 'd'], ['b', 'c'], ['a', 'c', 'd']])) must return ['a', 'b', 'c', 'd']. I tried the following implementations: from itertools im

Re: Logging module: problem with some mapping keys

2006-12-15 Thread Tekkaman
On Dec 14, 6:41 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Tekkaman wrote: >> lib is a symlink to lib64 > So my initial diagnosis was correct. Unfortunately I can no longer recommend > that you remove the symlink... > Yes. What I really meant in my first reply was &q

Re: Logging module: problem with some mapping keys

2006-12-14 Thread Tekkaman
Peter Otten wrote: > Tekkaman wrote: > > > Peter Otten wrote: > >> Tekkaman wrote: > >> > >> > Thanks for the hint, but it's not a symlink > >> > >> What does logging._srcfile contain? Should be > >> > >> >&g

Re: Logging module: problem with some mapping keys

2006-12-14 Thread Tekkaman
lib is a symlink to lib64 Peter Otten wrote: > Tekkaman wrote: > > > Peter Otten wrote: > >> Tekkaman wrote: > >> > >> > Thanks for the hint, but it's not a symlink > >> > >> What does logging._srcfile contain? Should be >

Re: Logging module: problem with some mapping keys

2006-12-14 Thread Tekkaman
'/usr/lib64/python2.4/logging/__init__.py' Peter Otten wrote: > Tekkaman wrote: > > > Thanks for the hint, but it's not a symlink > > What does logging._srcfile contain? Should be > > >>> import logging > >>> logging._srcfile > &#x

Re: Logging module: problem with some mapping keys

2006-12-14 Thread Tekkaman
Peter Otten wrote: > > An evil symlink, maybe? Thanks for the hint, but it's not a symlink > > $ ln -s /usr/local/lib/python2.4/logging > $ python > [snip] > >>> import logging > >>> logging.basicConfig(format="%(pathname)s") > >>> logging.getLogger().critical("yadda") > /usr/local/lib/python2.4/l

Re: Logging module: problem with some mapping keys

2006-12-14 Thread Tekkaman
e)s,%(name)s, > line %(lineno)s|%(message)s") ) > > iLog = logging.getLogger(logName) > iLog.addHandler(iHandler) > iLog.setLevel(logging.DEBUG) > > iLog.info('hello logging') > > > > it gives me: > > INFO|2006-12-13 19:57:33,575|test.py,LOG, line 1

Logging module: problem with some mapping keys

2006-12-13 Thread Tekkaman
I'm getting a strange behaviour from the "pathname" and "lineno" formatter mapping keys. Instead of my file and my line number I get: /usr/lib/python2.4/logging/__init__.py as the file, and 1072 as the line number. I set up my config as follows: logBaseConf = { 'level' : logging.DEBUG,