Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Antoon Pardon
On 2007-09-26, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 26 Sep, 13:22, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >> Well you should decide what you want. In a previous exchange one of the >> things that was wanted was that you could already seed a tree by using >> key word arguments so th

Re: Google and Python

2007-09-26 Thread Hendrik van Rooyen
"Nick Craig-Wood" wrote: > Hendrik van Rooyen wrote: > > "Paul Rubin" wrote: > > > > > "Hendrik van Rooyen" writes: > > Ok got it - so instead of starting a thread, as is current practice, you fork > > a process (possibly on another machine) and "hand over" the clie

Re: ~ bit-wise unary operator

2007-09-26 Thread Ladislav Andel
Wow, so many answers :). Thank you, guys :). Lada Michal Bozon wrote: > cau, > maybe int is represented internally as a signed integer > > you can use numpy types: > > import numpy ~ numpy.uint16(7978) > 57557 > > -m. > > > On Thu, 27 Sep 2007 00:14:49 +0200, Ladislav

Re: Asynchronous Messaging

2007-09-26 Thread Gabriel Genellina
En Thu, 27 Sep 2007 01:43:32 -0300, wink <[EMAIL PROTECTED]> escribi�: > You are most correct, but Queue is slow compared to deque but > not for the reason I guessed. Apparently it's because deque is > implemented in C while Queue is in python. Using the program below > it looks there is about a 3

Re: Python class method as an argument of a function in a C extension

2007-09-26 Thread mauro
On 26 Set, 19:00, Matimus <[EMAIL PROTECTED]> wrote: > > Can anybody give me an hint (or some link) on how to define > > 'aCFunction' and how to call 'self.myMethod' in the C source code? > > A python function defined in C accepts a pointer to self and a tuple > of arguments, each of which is also

Re: database persistence with mysql, sqlite

2007-09-26 Thread Bryan Olson
Lawrence D'Oliveiro wrote: > Bryan Olson wrote: > >> Lawrence D'Oliveiro wrote: >>> In Bryan Olson wrote: >>> coldpizza wrote: > It turned out that the method above ('SELECT * FROM TABLE LIMIT L1, > L2') works ok both with mysql and sqlite3, therefore I have decided to > stick wit

Re: Using closures and partial functions to eliminate redundant code

2007-09-26 Thread Gabriel Genellina
En Wed, 26 Sep 2007 23:01:17 -0300, Matthew Wilson <[EMAIL PROTECTED]> escribi�: > I wrote some code to create a user and update a user on a remote box by > sending emails to that remote box. When I was done, I realized that my > create_user function and my update_user function were effectively

Re: Delete values from a string using the index

2007-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. Note you can't do it with a string, since that's not mutable. -- http://mail.python.org/mailman/listinfo/python-list

How do I get the value out of a DOM Element

2007-09-26 Thread kj7ny
I have been able to get xml.dom.minidom.parse('somefile.xml') and then dom.getElementsByTagName('LLobjectID') to work to the point where I get something like: [] which I can get down to but then I can't find any way to just get the value out from the thing! .toxml() returns something like: u''.

Re: database persistence with mysql, sqlite

2007-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Bryan Olson wrote: > Lawrence D'Oliveiro wrote: >> In Bryan Olson wrote: >> >>> coldpizza wrote: It turned out that the method above ('SELECT * FROM TABLE LIMIT L1, L2') works ok both with mysql and sqlite3, therefore I have decided to stick with it

Re: ~ bit-wise unary operator

2007-09-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Hrvoje Niksic wrote: > If you want 16-bit unsigned arithmetic, use 2**16 + ~a, which yields > 57557. Or why not use "0x ^ a", which returns the same thing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Asynchronous Messaging

2007-09-26 Thread wink
Fredrik, You are most correct, but Queue is slow compared to deque but not for the reason I guessed. Apparently it's because deque is implemented in C while Queue is in python. Using the program below it looks there is about a 35:1 speed difference. 100 d.append 0.11s 0.1097us p

Re: scope, modyfing outside object from inside the method

2007-09-26 Thread Gabriel Genellina
En Wed, 26 Sep 2007 10:39:22 -0300, Marcin Stępnicki <[EMAIL PROTECTED]> escribi�: > At first glance (before adding id()) it's a little bit weird. The > original > object was supposedly "overwritten", but as one can see it has different > id then the new one. mystruct still holds references to

Re: Best way to do attribute docstrings?

2007-09-26 Thread Ken Kuhlman
On Sep 26, 12:25 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 25 Sep 2007 22:41:31 -0300,KenKuhlman<[EMAIL PROTECTED]> > escribi?: > > > Replying to myself in case someone finds this interesting. > > > Anyway, I took another shot at this with a little fresher mind, and it > > was qu

Re: database persistence with mysql, sqlite

2007-09-26 Thread Bryan Olson
Lawrence D'Oliveiro wrote: > In Bryan Olson wrote: > >> coldpizza wrote: >>> It turned out that the method above ('SELECT * FROM TABLE LIMIT L1, >>> L2') works ok both with mysql and sqlite3, therefore I have decided to >>> stick with it until I find something better. With Sqlite3 you are >>> supp

Re: Using closures and partial functions to eliminate redundant code

2007-09-26 Thread timaranz
On Sep 27, 2:01 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I wrote some code to create a user and update a user on a remote box by > sending emails to that remote box. When I was done, I realized that my > create_user function and my update_user function were effectively > identical except fo

Re: Tkinter / Tk 8.5

2007-09-26 Thread Scott David Daniels
Michal Bozon wrote: > Today has been released a first beta of Tk 8.5, including a Ttk > (tile) style engine, which makes possible the native look > of widgets on MS platform, without having to install any extension. > > Is there a chance it will be included in 2.5.x, 2.6 or 3.0 ? This is just a g

Re: Using closures and partial functions to eliminate redundant code

2007-09-26 Thread Paul McGuire
On Sep 26, 9:01 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I wrote some code to create a user and update a user on a remote box by > sending emails to that remote box. When I was done, I realized that my > create_user function and my update_user function were effectively > identical except fo

Using closures and partial functions to eliminate redundant code

2007-09-26 Thread Matthew Wilson
I wrote some code to create a user and update a user on a remote box by sending emails to that remote box. When I was done, I realized that my create_user function and my update_user function were effectively identical except for different docstrings and a single different value inside: ### V

Re: A question on python performance.

2007-09-26 Thread Bruno Desthuilliers
Joe Goldthwaite a écrit : > Hi everyone, > > I'm a developer who's been using python for a couple of years. I wrote a > fairly large application using it but I was learning the language at the > same time so it most of the code kind of sucks. > > I've learned a lot since then and I've been going

Re: Delete values from a string using the index

2007-09-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > How do I delete or remove values from a list del > or string You can't. Python's strings are immutables. > using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do > that? del a[0:5] print a -- http://mail.python.org/mailman

Re: ~ bit-wise unary operator

2007-09-26 Thread Michal Bozon
cau, maybe int is represented internally as a signed integer you can use numpy types: >>> import numpy >>> ~ numpy.uint16(7978) 57557 -m. On Thu, 27 Sep 2007 00:14:49 +0200, Ladislav Andel wrote: > Hello, > why ~ bit-wise unary operator returns -(x+1) and not bit inversion of > the given in

Re: Packaging and dependencies

2007-09-26 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > So, if fifteen different programs depend on library X, we'd have > > fifteen *separate* installations of library X on the same machine? > > > You need to get your opinions up to date. Fifteen copies of a single > library is nothing i

Re: Test-driven development and code size

2007-09-26 Thread Ben Finney
(Joel, please preserve attribution lines on your quoted material so we can see who wrote it.) Joel Hedlund <[EMAIL PROTECTED]> writes: > My presumption has been that in order to do proper test-driven > development I would have to make enormous test suites covering all > bases for my small hacks b

Re: A question on python performance.

2007-09-26 Thread Paul Hankin
On Sep 26, 7:26 pm, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > The code gets kind of wordy so I started trying to figure out how to call > them dynamically since the param type is the same as the method the > retrieves it. I came up with this; > > def getValue(trend, param, per): >return t

Re: ~ bit-wise unary operator

2007-09-26 Thread Grant Edwards
On 2007-09-26, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hello, > why ~ bit-wise unary operator returns -(x+1) and not bit inversion of > the given integer? > > example: > a = 7978 > a = ~a > python returns -7979 > > but I need to get back 57557 as in C language. It's not what C language return

Re: regex with specific list of string

2007-09-26 Thread Steve Holden
james_027 wrote: > Hi all, > >> This is fine IMO since the OP didn't specify the opposite. >> > > Thanks for all your replies, though I don't understand quite well the > going argument? What do you mean when you say "the OP didn't specify > the opposite"? > > There reason for using regex is beca

Re: Simple threading example freezes IDLE?

2007-09-26 Thread Sergio Correia
I think I have pinpointed the error: When the -print- command fills the screen, IDLE crashes. That is, if i have 30 empty lines before I start to push the current screen upwards, when the last of those lines is used, and its time to push the screen upwards, IDLE crashes. I'm using IDLE 1.2.1, Pyt

Re: regex with specific list of string

2007-09-26 Thread james_027
Hi all, > This is fine IMO since the OP didn't specify the opposite. > Thanks for all your replies, though I don't understand quite well the going argument? What do you mean when you say "the OP didn't specify the opposite"? There reason for using regex is because I am going to use it in Django'

Re: Script to extract text from PDF files

2007-09-26 Thread David Boddie
On Wed Sep 26 23:50:16 CEST 2007, byte8bits wrote: > On Sep 26, 4:49 pm, Svenn Are Bjerkem > wrote: > > > I have downloaded this package and installed it and found that the > > text-extraction is more or less useless. Looking into the code and > > comparing with the PDF spec show a very early im

Re: setuptools without unexpected downloads

2007-09-26 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Sep 26, 8:30 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> Fredrik Lundh wrote: >>> Paul Boddie wrote: P.S. Of course, the package maintainer problem manifests itself most prominently on Windows where you often see people asking for pre-built packages o

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Paul Hankin
On Sep 26, 9:52 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Paul Hankin <[EMAIL PROTECTED]> wrote: > >> So should Duncan's > > >> def __removekey(self, key): > >> if key in self.__addkeys: > >> del self.__addkeys[key] > >> else: > >> self.__delkeys.add(

Re: ~ bit-wise unary operator

2007-09-26 Thread Hrvoje Niksic
Ladislav Andel <[EMAIL PROTECTED]> writes: > Hello, why ~ bit-wise unary operator returns -(x+1) and not bit > inversion of the given integer? On 2s-complement architectures, -(x+1) *is* bit inversion of the given integer. > example: > a = 7978 > a = ~a > python returns -7979 > > but I need to g

Re: ~ bit-wise unary operator

2007-09-26 Thread Paul Hankin
On Sep 26, 11:14 pm, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hello, > why ~ bit-wise unary operator returns -(x+1) and not bit inversion of > the given integer? > > example: > a = 7978 > a = ~a > python returns -7979 > > but I need to get back 57557 as in C language. > > which is also in binary

GUI for viewing/editing python data structures?

2007-09-26 Thread Joshua J. Kugler
A while back, I seem to remember coming across a small program that could view and edit python data structures via a nice expanding tree view. I'm now in need of something like that (to verify data is imported correctly into a shelve file) and having a GUI would be much simpler than trying to wade

~ bit-wise unary operator

2007-09-26 Thread Ladislav Andel
Hello, why ~ bit-wise unary operator returns -(x+1) and not bit inversion of the given integer? example: a = 7978 a = ~a python returns -7979 but I need to get back 57557 as in C language. which is also in binary 000100101010 and inverted 111011010101 Is here any other operator or do I

Re: Simple threading example freezes IDLE?

2007-09-26 Thread Sergio Correia
I think the -print- command, as used in IDLE, is not thread-safe. I was bitten by an issue like that today, and the problem ended up being the -print- command I used. On the cmd line, it works per-fect-ly.. but IDLE seems to be the culprit. A possible answer seems to be to write a wrapper for prin

Re: Script to extract text from PDF files

2007-09-26 Thread byte8bits
On Sep 26, 4:49 pm, Svenn Are Bjerkem <[EMAIL PROTECTED]> wrote: > I have downloaded this package and installed it and found that the > text-extraction is more or less useless. Looking into the code and > comparing with the PDF spec show a very early implementation of text > extraction. Luckily it

Re: setuptools without unexpected downloads

2007-09-26 Thread kyosohma
On Sep 26, 8:30 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > Paul Boddie wrote: > > >> P.S. Of course, the package maintainer problem manifests itself most > >> prominently on Windows where you often see people asking for pre-built > >> packages or installers. > > > for th

Re: Matplotlib TkAgg WindowsXP ImportError

2007-09-26 Thread Simon Forman
On Sep 26, 1:19 pm, Simon Forman <[EMAIL PROTECTED]> wrote: > Hello, > > I just installed Matplotlib (and NumPy) on a windows XP machine, and > I'm getting the following traceback when I try to use the TkAgg > backend. > > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit > (Intel

Re: Matplotlib TkAgg WindowsXP ImportError

2007-09-26 Thread Simon Forman
On 9/26/07, Simon Forman <[EMAIL PROTECTED]> wrote: > Hello, > > I just installed Matplotlib (and NumPy) on a windows XP machine, and > I'm getting the following traceback when I try to use the TkAgg > backend. > > Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit > (Intel)] on >

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Duncan Booth
Paul Hankin <[EMAIL PROTECTED]> wrote: >> So should Duncan's >> >> def __removekey(self, key): >> if key in self.__addkeys: >> del self.__addkeys[key] >> else: >> self.__delkeys.add(key) >> >> be changed to: >> >> def __removekey(self, key): >>

Re: Script to extract text from PDF files

2007-09-26 Thread Svenn Are Bjerkem
On Sep 25, 9:18 pm, [EMAIL PROTECTED] wrote: > On Sep 25, 3:02 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > Googling for 'pdf to text python' and following the first link > > giveshttp://pybrary.net/pyPdf/ > > Doesn't work that well, I've tried it, you should too... the author > even admits th

Re: Delete values from a string using the index

2007-09-26 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do > that? > > Thanks. > If you want to do it all at once : del a[1:4:2] -- http://mail.python.org/mailman/listinfo/pyth

Re: Delete values from a string using the index

2007-09-26 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would > I do that? del a[0:5] Be sure to check out the relevant section of the Python tutorial. http://docs.python.org/tut/node7.

Tkinter / Tk 8.5

2007-09-26 Thread Michal Bozon
Today has been released a first beta of Tk 8.5, including a Ttk (tile) style engine, which makes possible the native look of widgets on MS platform, without having to install any extension. http://wiki.tcl.tk/11075 http://sourceforge.net/mailarchive/message.php?msg_name=1190813039.46fa5d6f6a06b%40

Re: Delete values from a string using the index

2007-09-26 Thread Erik Jones
On Sep 26, 2007, at 3:25 PM, [EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do > that? > > Thanks. > > -- > http://mail.python.org/mailman/listinfo/python-list >>> l = [

Re: Delete values from a string using the index

2007-09-26 Thread Ricardo Aráoz
[EMAIL PROTECTED] wrote: > How do I delete or remove values from a list or string using the > index. > > If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do > that? > > Thanks. > del a[1] del a[-5] -- http://mail.python.org/mailman/listinfo/python-list

Re: stdout and embedding into Windows apps

2007-09-26 Thread Thomas Schreiner
Hi, > I'm extending a windows application (C++) by embedding Python calls. > It seems to be a known problem that windows applications detach > immediately from the calling console, so that all output to stdout > (from both C++ and Python) doesn't get shown anywhere. > > A workaround seems to be

Re: PyS60

2007-09-26 Thread cyberco
I have used PyS60 quite a lot a while ago, but what is it you exactly wanted to know? One thing I can tell you is that it's a pity that it only runs on Series 60 phones and that the security restrictions of third edition devices severely limited the options for developers. 2B -- http://mail.pyth

Delete values from a string using the index

2007-09-26 Thread koutoo
How do I delete or remove values from a list or string using the index. If a = [1,2,3,4,5,6,7,8] and I want to get rid of 1 -5, how would I do that? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Raymond Hettinger
[James Stroud ] > Maybe its the PEP killers who act prematurely because I friggin' love > genexps and the little generators they generate. No, it's the PEP author who controls when they ask for pronouncement. The natural instinct is to ask for pronouncement as soon as you have an implementation an

Re: regex with specific list of string

2007-09-26 Thread Steve Holden
Carsten Haese wrote: > On Wed, 2007-09-26 at 15:13 -0300, Pablo Ziliani wrote: >> Carsten Haese wrote: >>> Unfortunately, that also matches margarine, mayonnaise, and octopus, >>> just to name a few ;-) >> (and so does the solution you sent before :) > > No, it doesn't. > s = set(['jan', 'fe

Re: A question on python performance.

2007-09-26 Thread Erik Jones
On Sep 26, 2007, at 1:26 PM, Joe Goldthwaite wrote: > Hi everyone, > > I'm a developer who's been using python for a couple of years. I > wrote a > fairly large application using it but I was learning the language > at the > same time so it most of the code kind of sucks. > > I've learned a l

Re: An Editor that Skips to the End of a Def

2007-09-26 Thread Simon Brunning
On 9/26/07, Bjoern Schliessmann <[EMAIL PROTECTED]> > You definitely used the wrong languages :) > > http://worsethanfailure.com/Articles/The-Other-Kind-of-RPG.aspx Ah, but one edits RPG with SEU[1], Undo - who needs it? -- Cheers, Simon B. [EMAIL PROTECTED] [1] http://tinyurl.com/yvra7l -- htt

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread James Stroud
Raymond Hettinger wrote: > As one who was submitted many PEPs, I can advise that the quickest way > to irrevocably kill an idea is to submit a PEP to early (we almost > didn't get genexps because the PEP was submitted pre-maturely). Maybe its the PEP killers who act prematurely because I friggin'

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Paul Rubin
Mark Summerfield <[EMAIL PROTECTED]> writes: > The sorteddict API that has emerged so far is (1) apart from the > constructor, everything is identical to dict, I don't see this as necessary, it's ok if it resembles dict as much as dbm does. > (2) the constructor takes the same args as sorted(),

Re: A question on python performance.

2007-09-26 Thread chris . monsanto
On Sep 26, 2:26 pm, "Joe Goldthwaite" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm a developer who's been using python for a couple of years. I wrote a > fairly large application using it but I was learning the language at the > same time so it most of the code kind of sucks. > > I've learned

Re: regex with specific list of string

2007-09-26 Thread Carsten Haese
On Wed, 2007-09-26 at 15:13 -0300, Pablo Ziliani wrote: > Carsten Haese wrote: > > Unfortunately, that also matches margarine, mayonnaise, and octopus, > > just to name a few ;-) > > (and so does the solution you sent before :) No, it doesn't. >>> s = set(['jan', 'feb', 'mar', 'apr', 'may', 'jun

A question on python performance.

2007-09-26 Thread Joe Goldthwaite
Hi everyone, I'm a developer who's been using python for a couple of years. I wrote a fairly large application using it but I was learning the language at the same time so it most of the code kind of sucks. I've learned a lot since then and I've been going through my code trying to organize it b

Re: regex with specific list of string

2007-09-26 Thread Pablo Ziliani
Carsten Haese wrote: > On Wed, 2007-09-26 at 12:49 -0400, Steve Holden wrote: >> james_027 wrote: >>> hi, >>> >>> how do I regex that could check on any of the value that match any one >>> of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', >>> 'sep', 'oct', 'nov', 'dec' >>> >>> Th

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Raymond Hettinger
[Mark Summerfield] > Below is a PEP proposal for a sorteddict. It arises out of a > discussion on this list that began a few weeks ago with the subject of > "An ordered dictionary for the Python library?" It is worth remembering that the long sought after datatype was a dict that could loop over k

Travel USA

2007-09-26 Thread travelingwebs1
http://world-traveling-destinations.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Guitars for 0$ !!!!!

2007-09-26 Thread nutsbreaker2
http://free-guitars.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: regex with specific list of string

2007-09-26 Thread Steve Holden
Carsten Haese wrote: > On Wed, 2007-09-26 at 12:49 -0400, Steve Holden wrote: >> james_027 wrote: >>> hi, >>> >>> how do I regex that could check on any of the value that match any one >>> of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', >>> 'sep', 'oct', 'nov', 'dec' >>> >>> Th

Re: regex with specific list of string

2007-09-26 Thread Carsten Haese
On Wed, 2007-09-26 at 12:49 -0400, Steve Holden wrote: > james_027 wrote: > > hi, > > > > how do I regex that could check on any of the value that match any one > > of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', > > 'sep', 'oct', 'nov', 'dec' > > > > Thanks > > >>> patr =

Matplotlib TkAgg WindowsXP ImportError

2007-09-26 Thread Simon Forman
Hello, I just installed Matplotlib (and NumPy) on a windows XP machine, and I'm getting the following traceback when I try to use the TkAgg backend. Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more info

Re: regex with specific list of string

2007-09-26 Thread Pablo Ziliani
Carsten Haese wrote: > On Wed, 2007-09-26 at 15:42 +, james_027 wrote: > >> hi, >> >> how do I regex that could check on any of the value that match any one >> of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', >> 'sep', 'oct', 'nov', 'dec' >> > > Why regex? You can si

Re: Python class method as an argument of a function in a C extension

2007-09-26 Thread Matimus
> Can anybody give me an hint (or some link) on how to define > 'aCFunction' and how to call 'self.myMethod' in the C source code? A python function defined in C accepts a pointer to self and a tuple of arguments, each of which is also a PyObject. If you pass a function or method, it will be inclu

Re: regex with specific list of string

2007-09-26 Thread Steve Holden
james_027 wrote: > hi, > > how do I regex that could check on any of the value that match any one > of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', > 'sep', 'oct', 'nov', 'dec' > > Thanks >>> patr = re.compile('jan|feb|mar|apr|may|jun|jul|aug|sep|nov|oct|dec') >>> patr.mat

Re: An Editor that Skips to the End of a Def

2007-09-26 Thread Jason M Barnes
On 9/26/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-09-26, Jason M Barnes <[EMAIL PROTECTED]> wrote: > > Off the top of my head, I can think of a few vim commands that > > have come in handy. I can search through a webpage in Firefox > > by using the same '/' search command that vim has.

Re: Missing documentation for ElementTree?

2007-09-26 Thread Fredrik Lundh
Robert Dailey wrote: > This is the documentation for 3.0a1? This is exactly what I was looking > for. Thank you. > > @Gabriel > Your documentation is also useful, it never occurred to me to check the > ElementTree website for documentation. Since it came with Python I > expected it to be cover

Re: Asynchronous Messaging

2007-09-26 Thread Fredrik Lundh
wink wrote: > But its performance is poor if the number of items on a > Queue becomes large because it is implemented using a list. > One of the things I was thinking of was doing another implementation > using of Queue which was based on deque. Updating from 2.3 to something newer will fix that

Re: regex with specific list of string

2007-09-26 Thread Carsten Haese
On Wed, 2007-09-26 at 15:42 +, james_027 wrote: > hi, > > how do I regex that could check on any of the value that match any one > of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', > 'sep', 'oct', 'nov', 'dec' Why regex? You can simply check if the given value is contained

Re: Regular Expressions: Can't quite figure this problem out

2007-09-26 Thread Robert Dailey
Even better! Now I can drop the regular expression that did the same thing :) Thanks! On 9/26/07, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Robert Dailey wrote: > > > Hmm, ElementTree.tostring() also adds a space between the last character > > of the element name and the />. Not sure why it is

Re: Missing documentation for ElementTree?

2007-09-26 Thread Robert Dailey
This is the documentation for 3.0a1? This is exactly what I was looking for. Thank you. @Gabriel Your documentation is also useful, it never occurred to me to check the ElementTree website for documentation. Since it came with Python I expected it to be covered by the python documentation. Thanks.

regex with specific list of string

2007-09-26 Thread james_027
hi, how do I regex that could check on any of the value that match any one of these ... 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' Thanks james -- http://mail.python.org/mailman/listinfo/python-list

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Mark Summerfield
On 26 Sep, 16:20, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Sep 26, 3:24 pm, Mark Summerfield <[EMAIL PROTECTED]> > wrote: > > > On 26 Sep, 14:59, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > > On Sep 26, 2:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > > > > Paul Hankin <[EMAIL PROTECTED]> w

Re: An Editor that Skips to the End of a Def

2007-09-26 Thread Neil Cerutti
On 2007-09-26, Jason M Barnes <[EMAIL PROTECTED]> wrote: > Off the top of my head, I can think of a few vim commands that > have come in handy. I can search through a webpage in Firefox > by using the same '/' search command that vim has. The > movement keys (h,j,k,l) are the same as in any pagin

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Jeremy Sanders
Mark Summerfield wrote: > The sorteddict API that has emerged so far is (1) apart from the > constructor, everything is identical to dict, (2) the constructor > takes the same args as sorted(), so if you want to seed with a dict or > with keywords you write sorteddict(dict(a=1,b=2), ...), (or you

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Paul Hankin
On Sep 26, 3:24 pm, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 26 Sep, 14:59, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > > > On Sep 26, 2:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > > > Paul Hankin <[EMAIL PROTECTED]> wrote: > > > > More flexibly, keep a set of inserted keys that hav

Re: Asynchronous Messaging

2007-09-26 Thread wink
On Sep 26, 4:47 am, wink <[EMAIL PROTECTED]> wrote: To make it easier to comment on the code, I'm including "mproc.py" file below. Fredrik, was commenting about using Queue and in fact I do. Queue is quite nice and is also thread safe, which is a requirement for this implementation. But its perform

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Steve Holden
Mark Summerfield wrote: > On 26 Sep, 13:22, Antoon Pardon <[EMAIL PROTECTED]> wrote: [...] >> So it seems the API needs some more sorting out. > > I think you missed some of the previous postings. > > The sorteddict API that has emerged so far is (1) apart from the > constructor, everything is id

Re: Script to extract text from PDF files

2007-09-26 Thread brad
David Boddie wrote: > There's a little information on that online: > http://www.glyphandcog.com/textext.html Thanks, I'll read that. > Just because inserting and encoding is well documented doesn't mean that the > reverse processes are easy. :-/ Boy, that's an understatement... most of the PDF

Script to extract text from PDF files

2007-09-26 Thread David Boddie
On Wed Sep 26 15:06:54 CEST 2007, byte8bits wrote: > On Sep 25, 10:19 pm, Lawrence D'Oliveiro central.gen.new_zealand> wrote: > > > This is inherent in the nature of PDF: it's a page-description language, > > not a document-interchange language. Each text-drawing command can put a > > block of t

Re: Tracking memory usage and object life time.

2007-09-26 Thread Istvan Albert
On Sep 26, 8:06 am, Berteun Damman <[EMAIL PROTECTED]> wrote: > that have been created after I don't need them anymore. I furthermore > don't really see why there would be references to these larger objects > left. (I can be mistaken of course). This could be tricky because you have a graph that

Re: Tracking memory usage and object life time.

2007-09-26 Thread Berteun Damman
On Sep 26, 2:31 pm, Bjoern Schliessmann wrote: > Did you check the return value of gc.collect? Also, try using > other "insight" facilities provided by the gc module. gc.collect states it cannot find any unreachable objects. Meanwhile the number of objects the garbage collector has to keep track o

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Mark Summerfield
On 26 Sep, 14:59, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Sep 26, 2:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > > > Paul Hankin <[EMAIL PROTECTED]> wrote: > > > More flexibly, keep a set of inserted keys that haven't yet been > > > included in the sorted list, and a set of deleted keys tha

Re: Packaging and dependencies

2007-09-26 Thread Diez B. Roggisch
> Agreed, but until we reach the ideal situation where everybody is using > the same package dependency system what's your practical solution? > "Self-contained" has the merit that nobody else's changes are going to > bugger about with my application on a customer's system. The extra disk > space i

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Paul Hankin
On Sep 26, 2:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Paul Hankin <[EMAIL PROTECTED]> wrote: > > More flexibly, keep a set of inserted keys that haven't yet been > > included in the sorted list, and a set of deleted keys that haven't > > yet been removed from the sorted list. The cache is i

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Duncan Booth
Paul Hankin <[EMAIL PROTECTED]> wrote: >> I suspect that for many use patterns you could improve performance >> significantly by having two levels of invalidation for the the key >> list: in __setitem__, if the key already exists you don't need to >> discard the list in __keycache (although if a k

Re: sorteddict PEP proposal [started off as orderedict]

2007-09-26 Thread Mark Summerfield
On 26 Sep, 13:22, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2007-09-26, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > > > > On 26 Sep, 11:27, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > >> Mark Summerfield <[EMAIL PROTECTED]> writes: > >> > On 26 Sep, 09:51, Hrvoje Niksic <[EMAIL PROTECTED]> w

My tail call optimizing decorator

2007-09-26 Thread Miguel Perez
Please critique this tail call optimizing decorator I've written. I've tried to fix the pitfalls of other proposed decorators, and the result is this one that supports mutual recursion, does not use exceptions, stack inspection or any implementation-dependent hack, and is pretty short and fast - th

Re: Test-driven development and code size

2007-09-26 Thread Fredrik Lundh
Diez B. Roggisch wrote: > Sounds good to me. IMHO there are two ways one gathers tests: > > - concrete bugs appear, and one writes a test that reproduces the bug & > eventually after the fix runs smoothly > > - new features are planned/implemented, and the tests accompany them right > from the

Re: Packaging and dependencies

2007-09-26 Thread Steve Holden
Ben Finney wrote: > "Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > >> In my opinion, python is steering here to a direction like Java with >> it's classpath: scripts like workingenv and it's successor (forgot >> the name) provide hand-tailored environments for a specific >> application. > > Wha

Re: scope, modyfing outside object from inside the method

2007-09-26 Thread Marcin Stępnicki
Dnia Mon, 24 Sep 2007 10:41:22 -0300, Ricardo Aráoz napisał(a): > Would this work for you? Thank you both for help. Well - yes and no :). It's getting more interesting: First, your code: class myrow(): def __init__(self, idict = {}): self.container = idict def __str__ (self):

Re: setuptools without unexpected downloads

2007-09-26 Thread Steve Holden
Fredrik Lundh wrote: > Paul Boddie wrote: > >> P.S. Of course, the package maintainer problem manifests itself most >> prominently on Windows where you often see people asking for pre-built >> packages or installers. > > for the record, I'd love to see a group of volunteers doing stuff like > th

RE: Test-driven development and code size

2007-09-26 Thread Ryan Ginstrom
> On Behalf Of Joel Hedlund > My presumption has been that in order to do proper > test-driven development I would have to make enormous test > suites covering all bases for my small hacks before I could > getting down and dirty with coding (as for example in > http://www.diveintopython.org/uni

Re: Test-driven development and code size

2007-09-26 Thread Diez B. Roggisch
Joel Hedlund wrote: >> test-driven development merely means that you take that test case and >> *keep it* in your unit test. Then, once you're assured that you will >> find the bug again any time it reappears, go ahead and fix it. > > My presumption has been that in order to do proper test-driven

Re: Script to extract text from PDF files

2007-09-26 Thread byte8bits
On Sep 25, 10:19 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > > Doesn't work that well... > > This is inherent in the nature of PDF: it's a page-description language, not > a document-interchange language. Each text-drawing command can put a block > of text anywhere

  1   2   >