Re: Need help to find origin of a memory leakage

2007-10-07 Thread David Tremouilles
Finaly catch the memory leak I was fighting with Was a tricky one, but the solution was simple: I had to include the contents of the notebook tab in a frame. Otherwise the memory is not released when you remove the tab. Any idea why is it like that??? Could it be kind of pygtk bug? I attach

Re: weakrefs and bound methods

2007-10-07 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > Without __del__, what should I have done to test that my code was > deleting objects and not leaking memory? See module gc in the Python standard library. > What should I do when my objects need to perform some special processing > when they a

Re: weakrefs and bound methods

2007-10-07 Thread Alex Martelli
Mathias Panzenboeck <[EMAIL PROTECTED]> wrote: ... > I only inserted them so I can see if the objects are really freed. How can > I see that without a __del__ method? You can use weakref.ref instances with finalizer functions - see the long post I just made on this thread for a reasonably rich

Re: weakrefs and bound methods

2007-10-07 Thread Alex Martelli
Mathias Panzenboeck <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch wrote: > > ``del b`` just deletes the name `b`. It does not delete the object. > > There's still the name `_` bound to it in the interactive interpreter. > > `_` stays bound to the last non-`None` result in the interpreter.

Re: Newbie packages Q

2007-10-07 Thread Alex Martelli
MarkyMarc <[EMAIL PROTECTED]> wrote: ... > > > And sys.path is /python/Test/bpack sys.path must be a LIST. Are you saying you set yours to NOT be a list, but, e.g., a STRING?! (It's hard to tell, as you show no quotes there). > > The 'Test' package is *not* in your sys.path. > > I can say

Re: Problem of Readability of Python

2007-10-07 Thread Brian Elmegaard
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > Use dicts, not lists or tuples: > > a = dict(name='yadda', val=42) > print a['name'] > print a['val'] I guess you will then need a list or tuple to store the dicts? I might have made it with a list of class instances: class a: def __init__(s

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 10:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > MarkyMarc <[EMAIL PROTECTED]> wrote: > >... > > > > > And sys.path is /python/Test/bpack > > sys.path must be a LIST. Are you saying you set yours to NOT be a list, > but, e.g., a STRING?! (It's hard to tell, as you show no quote

Re: Problem of Readability of Python

2007-10-07 Thread Alex Martelli
Licheng Fang <[EMAIL PROTECTED]> wrote: ... > Python Tutorial says an empty class can be used to do this. But if > namespaces are implemented as dicts, wouldn't it incur much overhead > if one defines empty classes as such for some very frequently used > data structures of the program? Just mea

Re: Newbie packages Q

2007-10-07 Thread Alex Martelli
MarkyMarc <[EMAIL PROTECTED]> wrote: ... > > > > > And sys.path is /python/Test/bpack > > > > sys.path must be a LIST. Are you saying you set yours to NOT be a list, > > but, e.g., a STRING?! (It's hard to tell, as you show no quotes there). ... > > > I also tried to put /python/ and /pyth

Re: Newbie packages Q

2007-10-07 Thread MarkyMarc
On Oct 7, 10:31 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > MarkyMarc <[EMAIL PROTECTED]> wrote: > >... > > > > > > > And sys.path is /python/Test/bpack > > > > sys.path must be a LIST. Are you saying you set yours to NOT be a list, > > > but, e.g., a STRING?! (It's hard to tell, as you s

Re: Problem of Readability of Python

2007-10-07 Thread Paul McGuire
On Oct 7, 1:07 pm, Licheng Fang <[EMAIL PROTECTED]> wrote: > Python is supposed to be readable, but after programming in Python for > a while I find my Python programs can be more obfuscated than their C/C > ++ counterparts sometimes. Part of the reason is that with > heterogeneous lists/tuples at

Re: Override 'and' and 'or'

2007-10-07 Thread John Machin
On 8/10/2007 1:57 AM, Diez B. Roggisch wrote: > Kay Schluehr schrieb: >> You can see what "and" and "or" are actually doing: >> >> import dis >> dis.dis(lambda: x or y and z) >> >> 1 0 LOAD_GLOBAL 0 (x) >> 3 JUMP_IF_TRUE11 (to 17) >>

Re: Problem of Readability of Python

2007-10-07 Thread John Nagle
Licheng Fang wrote: > Python is supposed to be readable, but after programming in Python for > a while I find my Python programs can be more obfuscated than their C/C > ++ counterparts sometimes. Part of the reason is that with > heterogeneous lists/tuples at hand, I tend to stuff many things into

tinyp2p - trying to get it to work

2007-10-07 Thread Fantus
Hello I am doing a small research and I found this: http://www.freedom-to-tinker.com/tinyp2p.html I tried to get it to work. So far I managed to run it as a server using a command: > python tinyp2p.py haslo server 10.10.10.1 2233 It starts listening on a given port so I assume it works fine

finding out the call (and not only the caller)

2007-10-07 Thread Francesco Guerrieri
Hi, Today I've been thinking a bit about the "python internals". Inspired by this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062 I found out a little problem which haven't been able to solve. In short, is there a way to find out how a given name lookup was started? It is not

Re: Yet another comparison of Python Web Frameworks

2007-10-07 Thread Istvan Albert
On Oct 7, 12:24 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > Here we disagree: I think that a programmer should know what he > is using. My point was that they should not *need* to know. Too much information can be detrimental. > > Where is the session data stored: in memory, files, databa

Re: weakrefs and bound methods

2007-10-07 Thread Mathias Panzenboeck
Alex Martelli wrote: > Mathias Panzenboeck <[EMAIL PROTECTED]> wrote: > >> Marc 'BlackJack' Rintsch wrote: >>> ``del b`` just deletes the name `b`. It does not delete the object. >>> There's still the name `_` bound to it in the interactive interpreter. >>> `_` stays bound to the last non-`None`

Re: ANN: Pyrex 0.9.6

2007-10-07 Thread Colin J. Williams
Diez B. Roggisch wrote: > Colin J. Williams schrieb: >> Greg Ewing wrote: >>> Pyrex 0.9.6 is now available: >>> >>>http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ >>> >>> There is a *lot* of new stuff in this version, too much >>> to fit into this announcement. Read all about it here: >>>

Re: Problem of Readability of Python

2007-10-07 Thread John Machin
On 8/10/2007 4:14 AM, Steven Bethard wrote: > Licheng Fang wrote: >> Python is supposed to be readable, but after programming in Python for >> a while I find my Python programs can be more obfuscated than their C/C >> ++ counterparts sometimes. Part of the reason is that with >> heterogeneous lists

Re: Problem of Readability of Python

2007-10-07 Thread Steven D'Aprano
On Sun, 07 Oct 2007 13:24:14 -0700, Alex Martelli wrote: > And yes, you CAN save about 1/3 of those 85 nanoseconds by having > '__slots__=["zop"]' in your class A(object)... but that's the kind of > thing one normally does only to tiny parts of one's program that have > been identified by profilin

Re: Newbie packages Q

2007-10-07 Thread Alex Martelli
MarkyMarc <[EMAIL PROTECTED]> wrote: ... > > As long as '/python' comes in the list before any other directory that > > might interfere (by dint of having a Test.py or Test/__init__.py), and > > in particular in the non-pathological case where there are no such > > possible interferences, my ass

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-07 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > For example, a dog with no owner, wandering freely (adverb), would not be > called a free dog (adjective), to mean possessing freedom. Yes it would. City council regulations would commonly contain phrases such as "dogs are not allowed to

Re: Problem of Readability of Python

2007-10-07 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 07 Oct 2007 13:24:14 -0700, Alex Martelli wrote: > > > And yes, you CAN save about 1/3 of those 85 nanoseconds by having > > '__slots__=["zop"]' in your class A(object)... but that's the kind of > > thing one normally does only to tiny parts of

Re: Cross platform way of finding number of processors on a machine?

2007-10-07 Thread Nicholas Bastin
On 10/6/07, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > John <[EMAIL PROTECTED]> wrote: > > Is there a way to find the number of processors on a machine (on linux/ > > windows/macos/cygwin) using python code (using the same code/cross > > platform code)? > > >From processing

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-07 Thread Nicholas Bastin
On 05 Oct 2007 16:23:50 GMT, Stargaming <[EMAIL PROTECTED]> wrote: > On Fri, 05 Oct 2007 08:37:05 -0700, timw.google wrote: > >> I can't ssh w/o supplying a password. That's the way the security is > >> set up here. > >> > >> How do I use python to do this, or do I just have to write a zsh > >> scr

Re: Problem using subprocess.Popen on windows

2007-10-07 Thread Nicholas Bastin
On 10/7/07, jorma kala <[EMAIL PROTECTED]> wrote: > from subprocess import * > > p1 = Popen(["dir"], stdout=PIPE) > output = p1.communicate()[0] > > > But I get a WindowsError : [Error 2] File Not Found Tim answered your actual question, but why are you doing this in the first place? The Py

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-07 Thread Damien Kick
Roedy Green wrote: > On Fri, 28 Sep 2007 18:27:04 -0500, Damien Kick <[EMAIL PROTECTED]> > wrote, quoted or indirectly quoted someone who said : > >> "free as in beer". > > but does not "free beer" nearly always come with a catch or implied > obligation? I had been trying to find a good Nietzs

Re: tinyp2p - trying to get it to work

2007-10-07 Thread Marc Christiansen
Fantus <[EMAIL PROTECTED]> wrote: > Hello > > I am doing a small research and I found this: > > http://www.freedom-to-tinker.com/tinyp2p.html [...] > Now when I try to run a client using following command: > > > python tinyp2p.py haslo client http://10.10.10.1:2233 koniki > > it gives me some s

a good website for softwares,movies and music etc.

2007-10-07 Thread panguohua
www.space666.com support -- http://mail.python.org/mailman/listinfo/python-list

were group "Python 2.4" bugs ported over to the new bug tracker?

2007-10-07 Thread Gregory P. Smith
This bug about a urllib2 urlopen memory leak is still present but I don't see it in the new bug tracker anywhere: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1208304&group_id=5470 If this one is missing, presumably there are others? -gps -- http://mail.python.org/mailman/listi

Re: weakrefs and bound methods

2007-10-07 Thread Steven D'Aprano
On Sun, 07 Oct 2007 12:55:29 -0700, Alex Martelli wrote: >> What should I do when my objects need to perform some special >> processing when they are freed, if I shouldn't use __del__? > > The solid, reliable way is: > > from __future__ import with_statement > > and use module contextlib from

Re: Problem of Readability of Python

2007-10-07 Thread Steven Bethard
Alex Martelli wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> class Record(object): >> __slots__ = ["x", "y", "z"] >> >> has a couple of major advantages over: >> >> class Record(object): >> pass >> >> aside from the micro-optimization that classes using __slots__ are faster >> and s

Re: weakrefs and bound methods

2007-10-07 Thread Michele Simionato
On Oct 7, 11:28 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 07 Oct 2007 12:55:29 -0700, Alex Martelli wrote: > >> What should I do when my objects need to perform some special > >> processing when they are freed, if I shouldn't use __del__? > > > The solid, reliable way is: > > > from

Don't use __slots__ (was Re: Problem of Readability of Python)

2007-10-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > >You can use __slots__ [...] Aaaugh! Don't use __slots__! Seriously, __slots__ are for wizards writing applications with huuuge numbers of object instances (like, millions of instances). For an extended thread about t

Re: Don't use __slots__ (was Re: Problem of Readability of Python)

2007-10-07 Thread Michele Simionato
On Oct 8, 12:27 am, [EMAIL PROTECTED] (Aahz) wrote: > > Aaaugh! Don't use __slots__! +1 QOTW ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem of Readability of Python

2007-10-07 Thread Michele Simionato
On Oct 7, 7:58 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > If you REALLY pine for Pascal's records, you might choose to inherit > from ctypes.Structure, which has the additional "advantages" of > specifying a C type for each field and (a real advantage;-) creating an > appropriate __init__ metho

Re: Yet another comparison of Python Web Frameworks

2007-10-07 Thread Michele Simionato
On Oct 7, 6:14 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Oct 7, 12:24 pm, Michele Simionato <[EMAIL PROTECTED]> > wrote: > > > Here we disagree: I think that a programmer should know what he > > is using. > > My point was that they should not *need* to know. Too much information > can be de

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-07 Thread bbound
On Oct 7, 9:07 pm, Damien Kick <[EMAIL PROTECTED]> wrote: > Perhaps our word "man" (manas) still expresses something of precisely > this feeling of self-satisfaction: man designated himself as the > creature that measures values, evaluates and measures, as the "valuating > animal as such".[1] Don'

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-07 Thread Lew
[EMAIL PROTECTED] wrote: > Don't both "man" and those words for measurement come ultimately from > words for "hand" (similarly to words like "manual", as in labor)? Our > clever hands with their opposable thumbs being considered a defining > characteristic. And our tool use thus derived. Handspans

Re: tinyp2p - trying to get it to work

2007-10-07 Thread Fantus
Marc Christiansen pisze: >> Can anybody help me to solve this? Please. I did browse google but found >> nothing. > > I had a (not so quick) look. The code proves its point (i.e. writing a > very small p2p application is possible), but it is horrible. With only > one server, the code is broken; ma

Re: Top Programming Languages of 2013

2007-10-07 Thread Tim Roberts
Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > >import friends >import sex > >try: > sex.have() >except ErrectionError, PrematureError: > pass >finally: > sex.brag(friends) Well, if "ErrectionError" ever becomes a real exception, I certainly get a boatload of email every day from

Re: Yet another comparison of Python Web Frameworks

2007-10-07 Thread John Nagle
Michele Simionato wrote: > I wait with > impatience the time when Web programming will become a solved > problem with a standard built-in solution that works. That will probably come from Microsoft. At least for all-Microsoft environments. They're the only player who controls enough of the p

Re: setuptools without unexpected downloads

2007-10-07 Thread John
On Sep 27, 11:42 am, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Sep 26, 2:09 am, Ben Finney <[EMAIL PROTECTED]> wrote: > > > behaviour with a specific invocation of 'setup.py'. But how can I > > disallow this from within the 'setup.py' program, so my users don't > > have to be aware of this unex

<    1   2