Re: gc.garbage

2007-08-30 Thread Chris Mellon
On 8/30/07, 7stud <[EMAIL PROTECTED]> wrote: > On Aug 30, 3:50 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > gc.set_debug(gc.DEBUG_LEAK) > > > print gc.garbage > > > > > --output:-- > > > [] > > > gc: uncollectable > > > gc: uncollectable > > > gc: uncollectable > > > gc: uncollectable

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Chris Mellon
On 8/29/07, Russ <[EMAIL PROTECTED]> wrote: > > > But it's always a good idea to make your software "correct and as > > reliable as possible", isn't it? The problem is the external constraints > > on the project. As the old saying goes: "Cheap, fast, reliable: choose > > any two". > > If you are su

Re: list index()

2007-08-30 Thread Chris Mellon
On 8/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > That wish will only come true if you maintain your own fork of Python 3. > > has_key() will go away, period. It has been made obsolete by "in", which > > is faster and more concise. > > Is there really some reason "key" IN dict can be

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Chris Mellon
On 8/30/07, Russ <[EMAIL PROTECTED]> wrote: > > > PEP 316 introduces new syntax for a limited use feature. That's pretty > > much a no-starter, in my opinion, and past experience tends to bear > > that out. Furthermore, it predates decorators and context managers, > > which give all the syntax sup

Re: gc.garbage

2007-08-30 Thread Chris Mellon
On 8/30/07, 7stud <[EMAIL PROTECTED]> wrote: > On Aug 30, 12:36 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 8/30/07, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Aug 30, 3:50 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wro

Re: Is LOAD_GLOBAL really that slow?

2007-08-30 Thread Chris Mellon
On 8/30/07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Aug 30, 12:04 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 8/30/07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Aug 29, 8:33 pm, Carsten Haese <[EMAIL PROTECTED]&

Re: list index()

2007-08-30 Thread Chris Mellon
On 8/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Aug 30, 4:31 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > [EMAIL PROTECTED] writes: > > > In my case of have done os.listdir() on two directories. I want to see > > > what files are in directory A that are not in directory B. > > > >

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Chris Mellon
On 8/30/07, Russ <[EMAIL PROTECTED]> wrote: > > Bruno Desthuilliers wrote: > > Russ a écrit : > > (snip) > > > > > I don't see how you can avoid adding some new syntax, given that > > > Python does not > > > currently have syntax for specifying invariants and pre- and post- > > > conditions. > > >

Re: So what exactly is a complex number?

2007-08-31 Thread Chris Mellon
On 8/31/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Thu, 2007-08-30 at 20:11 -0500, Lamonte Harris wrote: > > Like in math where you put letters that represent numbers for place > > holders to try to find the answer type complex numbers? > > Is English your native language? I'm having a hard

Re: strings (dollar.cents) into floats

2007-08-31 Thread Chris Mellon
On 8/31/07, Steve Holden <[EMAIL PROTECTED]> wrote: > sturlamolden wrote: > > On 31 Aug, 02:12, Wildemar Wildenburger > > <[EMAIL PROTECTED]> wrote: > > > >> I've heard (ok, read) that several times now and I understand the > >> argument. But what use is there for floats, then? When is it OK to use

Re: reload() gone?

2007-08-31 Thread Chris Mellon
On 8/31/07, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > On Aug 31, 7:10 pm, "Bernard Lebel" <[EMAIL PROTECTED]> wrote: > > I read in the Python 3.0 documentation that reload() was removed, > > without further explanations. > > > > http://docs.python.org/dev/3.0/whatsnew/3.0.html?highlight=reload

Re: Python Unicode to String conversion

2007-08-31 Thread Chris Mellon
On 8/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm having quite some troubles trying to convert Unicode to String > (for use in psycopg, which apparently doesn't know how to cope with > unicode strings). > > The error I keep having is something like this: > ERREUR: Séq

Re: Why is this loop heavy code so slow in Python? Possible Project Euler spoilers

2007-09-02 Thread Chris Mellon
On 9/2/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Wildemar Wildenburger schrieb: > > Martin v. Löwis wrote: > (2) it is a interpretation language > >>> Not quite. It's compiled to byte-code - just like Java (would you call > >>> Java an 'interpreted language' ?) > >> > >> Python is not

Re: Sort of an odd way to debug...

2007-09-04 Thread Chris Mellon
On 9/4/07, xkenneth <[EMAIL PROTECTED]> wrote: > All, > > Sorry for the vague topic, but I really didn't know how to > describe what I want to do. I'd like to almost do a traceback of my > code for debugging and I thought this would be a really cool way to do > it if possible. > > What I'd like

Re: Undeterministic strxfrm?

2007-09-04 Thread Chris Mellon
On 9/4/07, Tuomas <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Tue, 04 Sep 2007 07:34:54 -0300, Tuomas > > <[EMAIL PROTECTED]> escribi�: > > > >> Python 2.4.3 (#3, Jun 4 2006, 09:19:30) > >> [GCC 4.0.0 20050519 (Red Hat 4.0.0-8)] on linux2 > >> Type "help", "copyright", "credits"

Re: function call

2007-09-04 Thread Chris Mellon
On 9/3/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > ianaré a écrit : > > Hey all, > > > > Is there a way of printing out how a function was called? In other > > words if I do the following: > > > > def someFunction(self): > > self.someOtherFunction(var1, var2) > > > > > > I would get so

Re: Checking if elements are empty

2007-09-05 Thread Chris Mellon
On 9/5/07, Steve Holden <[EMAIL PROTECTED]> wrote: > Doran, Harold wrote: > > > > Is there a way to check if the first element of y is null? > > > > len(y[0]) == 0 > > would be the obvious way, assuming "null" means "the null string". > Better spelled as if y[0]: -- http://mail.python.org/mailm

Re: Best practice prompting for password

2007-09-07 Thread Chris Mellon
On 9/7/07, GiBo <[EMAIL PROTECTED]> wrote: > Hi, > > what's the best practice to securely prompt user for password on console > in Python? IIRC some programs like SSH do a lot to ensure that the input > comes from TTY and is not redirected from somewhere and several other > checks. In the case of O

Re: wxpython automate progress bar

2007-09-08 Thread Chris Mellon
On 9/8/07, Jimmy <[EMAIL PROTECTED]> wrote: > Hi, I want a progress bar to increase automatically, so I wrote code > like this: > current = 0 > while True: > if current == 100: > current = 0 > self._gaug

Re: Checking if elements are empty

2007-09-10 Thread Chris Mellon
On 9/10/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-09-08, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > > Lawrence D'Oliveiro wrote: > > if y[0]: > Not a good idea. > >>> Why not? > >> > >> Because there is a situation where your version of the test > >> will fail even if t

Re: Checking if elements are empty

2007-09-10 Thread Chris Mellon
On 9/10/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-09-10, Chris Mellon <[EMAIL PROTECTED]> wrote: > > On 9/10/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > >> On 2007-09-08, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > >

Re: Is the wxPython list down?

2007-09-12 Thread Chris Mellon
On 9/12/07, Frank Millman <[EMAIL PROTECTED]> wrote: > On Sep 12, 3:10 pm, [EMAIL PROTECTED] wrote: > > Hi, > > > > Does anyone know if the wxPython mailing list is having issues? I > > subscribe to it and haven't seen anything come through since > > 09/06/2007. I went to ActiveState's archives and

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Chris Mellon
On 9/12/07, Charles Fox <[EMAIL PROTECTED]> wrote: > Thanks guys -- yeah these two stategies (short s.varname; and explicit > rescoping, a=self.a etc) are more or less what I was using. That's > still kind of annoying though. > > The s.varname approach still makes numerical code much harder to rea

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Chris Mellon
On 9/12/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]> > wrote: > > On Sep 12, 2:42 pm, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > > On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: > > > In fact, I

Re: Python 3K or Python 2.9?

2007-09-12 Thread Chris Mellon
On 9/12/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > Duncan Booth <[EMAIL PROTECTED]> wrote: >... > > As for omitting 'self' from method definitions, at first site you might > > think the compiler could just decide that any 'def' directly inside a > > class could silently insert 'self' as an

Re: Possible suggestion for removing the GIL

2007-09-13 Thread Chris Mellon
On 9/13/07, Prateek <[EMAIL PROTECTED]> wrote: > On Sep 13, 1:36 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Prateek wrote: > > > Hi, > > > > > Recently there was some talk on removing the GIL and even the BDFL has > > > written a blog post on it. > > > I was trying to come up with a scal

Re: Project organization and import

2007-03-05 Thread Chris Mellon
On 5 Mar 2007 08:32:34 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > Jorge, thanks for your response. I replied earlier but I think my > response got lost. I'm trying again. > > On Mar 4, 5:20 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote: > > Why? RCS systems can merge changes. A RCS system is no

Re: Python GUI + OpenGL

2007-03-05 Thread Chris Mellon
On 3/5/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Dag wrote: > > > On Fri, 02 Mar 2007 18:30:34 +0100, Diez B. Roggisch <[EMAIL PROTECTED]> > > wrote: > >> Achim Domma wrote: > >> > >>> Hi, > >>> > >>> I'm developing a GUI app in Python/C++ to visualize numerical results. > >>> Currently I'm

Re: Project organization and import

2007-03-05 Thread Chris Mellon
On 5 Mar 2007 10:31:33 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 5, 9:15 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > That's actually the exact benefit of unit testing, but I don't feel > > that you've actually made a case t

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 5 Mar 2007 23:35:00 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 5, 11:06 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > I never advocated big files with many functional units - just files > > that are "just big enough". > >

Re: wxPython import error...

2007-03-06 Thread Chris Mellon
On 4 Mar 2007 16:42:07 -0800, king kikapu <[EMAIL PROTECTED]> wrote: > Hi, > > i am just completed installing Python/Pydev/Eclipse/wxPython on an > Ubuntu system and all are running fine except program that contains > references to wx > > It gives me: > ImportError: /usr/lib/python2.4/site-packages

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 6 Mar 2007 08:42:00 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 5, 2:18 pm, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > Martin Unsal a écrit : > > > For example, say > > > you want to organize the widgets package as follows: > > > > > widgets/scrollbar/*.py > > > widgets/for

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 6 Mar 2007 09:09:13 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 6, 6:07 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > Because you're advocating single class per file. > > What I actually said was "Smallest practical functional block

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 6 Mar 2007 09:24:32 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 6, 8:56 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > Scrollbar *can't* assume that util will be present in its namespace, > > because it won't be unless it im

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 6 Mar 2007 09:49:55 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 6, 9:19 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > You do? Or do you only have trouble because you don't like using "from > > foo import Foo" because y

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 6 Mar 2007 10:30:03 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 6, 9:34 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > It assumes that util.common is a module thats on the PYTHONPATH. > > Now we're getting somewhere. :) > > >

Re: Project organization and import

2007-03-06 Thread Chris Mellon
On 6 Mar 2007 10:58:14 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 6, 10:13 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > You have to reload the importing module as well as the module that > > changed. That doesn't require rewriting the

Re: Why does SocketServer default allow_reuse_address = false?

2007-03-07 Thread Chris Mellon
On 3/7/07, Joshua J. Kugler <[EMAIL PROTECTED]> wrote: > Greg Copeland wrote: > >> Is there some history to this of which I'm not aware? Is there a good > >> reason for it to default to false? > > > Long story short, it is not a bug. It is a feature. The proper > > default is that of the OS, wh

Re: merits of Lisp vs Python

2007-03-08 Thread Chris Mellon
On 3/8/07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 08 Mar 2007 06:13:15 GMT, John Nagle <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > When starting out with this project, I'd made the assumption that > > Python was a stable, working, well-supported

Re: a better solution for GUI in python

2007-03-12 Thread Chris Mellon
On 3/11/07, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann napisał(a): > > >> I'd recommend pyGTK. It's easy to use, delivers astonishing > >> results and is perfectly portable as far as I know. > > > > And how does it look on Windows? :) > > On styled Windows XP it looks like any oth

Re: a better solution for GUI in python

2007-03-12 Thread Chris Mellon
On 3/12/07, David Boddie <[EMAIL PROTECTED]> wrote: > On Monday 12 March 2007 16:57, Chris Mellon wrote: > > > Gtk I consider an extremely poor contender as a cross platform > > toolkit. The runtime is enormous and it makes little effort to appear > > native on any

Re: block scope?

2007-04-06 Thread Chris Mellon
On 4/6/07, Neal Becker <[EMAIL PROTECTED]> wrote: > One thing I sometimes miss, which is common in some other languages (c++), > is idea of block scope. It would be useful to have variables that did not > outlive their block, primarily to avoid name clashes. This also leads to > more readable cod

Re: Memory allocation problem with python 2.4.3

2007-04-09 Thread Chris Mellon
On 4/9/07, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 9 Apr 2007 04:12:59 -0700, "Brice-Olivier Demory" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > Nothing indicates a lack of memory. > > No? I'd consider a machine with only 23MB free rather heavily use

Re: tuples, index method, Python's design

2007-04-10 Thread Chris Mellon
On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Tue, 2007-04-10 at 19:21 +0200, BJörn Lindqvist wrote: > > On 4/10/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > > > opponents = tuple(x for x in p if x is not current_player) > > > > > > > > > Your alternative is wrong because it wont

Re: Kill thread or at least socket.getaddrinfo

2007-04-10 Thread Chris Mellon
On 10 Apr 2007 11:07:51 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On 26 Mar., 18:08, [EMAIL PROTECTED] wrote: > > you know the pid, you can kill it, but that's not always a > > clean way of accomplishing the task. > > So I have to open the connection in a new process... Sigh.. How I hat

Re: tuples, index method, Python's design

2007-04-11 Thread Chris Mellon
On 4/11/07, Hamilton, William <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] > [mailto:python- > > [EMAIL PROTECTED] On Behalf Of Steven > D'Aprano > > Sent: Wednesday, April 11, 2007 7:49 AM > > To: python-list@python.org > > Subject: Re: tuples, index method

Re: tuples, index method, Python's design

2007-04-11 Thread Chris Mellon
On 4/10/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > > while not game_has_ended: > > > for current_player in p: > > > player_does_something(current_player) > > > > > > > I'm curious why someone would even consider using a tuple in this case > > regardless. I think that much of the desir

Re: tuples, index method, Python's design

2007-04-11 Thread Chris Mellon
On 11 Apr 2007 08:37:39 -0700, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 11 Apr, 16:14, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > > If you want a language that just adds whatever methods anyone thinks > > of, along with whatever aliases for it an

Re: tuples, index method, Python's design

2007-04-12 Thread Chris Mellon
On 4/12/07, Alan Isaac <[EMAIL PROTECTED]> wrote: > I am still puzzled by this discussion. > > As I said: > I doubt that *anyone* who programs in Python > has not encountered the situation where they change > a tuple to a list *solely* for the purpose of getting > access to the index method. This s

Re: tuples, index method, Python's design

2007-04-16 Thread Chris Mellon
On 4/12/07, Alan Isaac <[EMAIL PROTECTED]> wrote: > Chris Mellon said: > > Sure. I have never done this. In fact, I have only ever written code > > that converted a tuple to a list once, and it was because I wanted > > pop(), not index() > > Well then you apparen

Re: Try this

2007-09-17 Thread Chris Mellon
On 9/17/07, Steve Holden <[EMAIL PROTECTED]> wrote: > "Cretin" (in the sense of possessing sub-normal intelligence, as I do > not know whether or not you have a thyroid deficiency) because you do > not seem to be able to think of the needs of the larger community, and > respond to argument with non

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-20 Thread Chris Mellon
On 9/19/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 19, 5:08 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > "Terry Reedy" <[EMAIL PROTECTED]> wrote in message > > This is a little confusing because google groups does not show your > original post (not uncommon for them to lose a pos

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-20 Thread Chris Mellon
On 20 Sep 2007 07:43:18 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > That's why your "comparatively wimpy site" preferred to throw extra web > > servers at the job of serving webpages rather than investing in smarter, > > harder-working

Re: Sets in Python

2007-09-20 Thread Chris Mellon
On 9/20/07, Dustan <[EMAIL PROTECTED]> wrote: > On Sep 19, 10:58 pm, Bryan Olson <[EMAIL PROTECTED]> wrote: > > Bad news: Python 3000 has no immutable type for byte-strings. > > The new bytes type cannot serve for dict keys or set members. > > Many things one would want to hash are unhashable -- fo

Re: Sets in Python

2007-09-20 Thread Chris Mellon
On 9/20/07, OKB (not okblacke) <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > > But of course you can't look up the dict by value, only by > > identity. But that's what you wanted. > > Actually, if I understand the OP's examples right, he wants to look > up only by value, not by id

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Chris Mellon
On 9/24/07, Ratko <[EMAIL PROTECTED]> wrote: > > If your use case is to make sure a given ('abstract') method has been > > overriden, the canonical solution is to raise NotImplementedError in the > > base class's implementation > > I am not really interested in forcing the subclass to implement a >

Re: Cross-platform time out decorator

2007-09-27 Thread Chris Mellon
On 9/27/07, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Joel <[EMAIL PROTECTED]> writes: > > >> Note that, unlike the original alarm code, it doesn't really interrupt > >> the timed-out method, it just returns the control back to the caller, > >> using an exception to mark that a timeout occurred.

Re: Python 3.0 migration plans?

2007-09-28 Thread Chris Mellon
On 9/28/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > On Sep 28, 2:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > TheFlyingDutchman wrote: > > > > All serious languages are turing-complete. So can we put away with this > > non-sense argument right away, please? > > You said it was a

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-02 Thread Chris Mellon
On 10/1/07, bramble <[EMAIL PROTECTED]> wrote: > What is the backstory to why Python includes Tk bindings, as opposed > to some other set of bindings? > > I've written a few little Tkinter-based apps, and it's nice and > simple. I like it well enough. That said though, I keep feeling the > gravitat

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > PyGtk has poor cross platform support, a very large footprint (the > > largest of all these libraries) > > It's larger than wxWidgets on top

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/2/07, bramble <[EMAIL PROTECTED]> wrote: > On Oct 2, 11:07 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > > PyGtk has poor cross platform support, a very large footprint (the > > largest of all these libraries) as well as a complicated runt

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/3/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote: > > On 10/2/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2007-10-02, Chris Mellon <[EMAIL PROTECTED]> wrote: > >> > &g

Re: gui toolkits: the real story? (Tkinter, PyGTK, etc.)

2007-10-03 Thread Chris Mellon
On 10/3/07, bramble <[EMAIL PROTECTED]> wrote: > On Oct 3, 1:39 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 10/3/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > > > > > On 2007-10-03, Chris Mellon <[EMAIL PROTECTED]> wrote: &

Re: Starting a thread before wxPython bootup ... interesting.

2007-10-04 Thread Chris Mellon
On 10/4/07, Shafik <[EMAIL PROTECTED]> wrote: > Hello folks, > > I'm having an issue with mixing wxPython and threading ... I realize > multi-threading always introduces subtle bugs, but the following > scenario is just odd: > > I start a dummy thread, that does nothing but increment a counter and

Re: Don't understand module search path...

2007-10-04 Thread Chris Mellon
On 10/4/07, mhearne808[insert-at-sign-here]gmail[insert-dot-here]com <[EMAIL PROTECTED]> wrote: > I think I don't understand how the module search path works... > > Let's say I have a folders called 'test'. Underneath it, I create two > more folders called 'foo' and 'bar'. > > In 'foo', I create a

Re: unit testing

2007-10-04 Thread Chris Mellon
On 10/4/07, brad <[EMAIL PROTECTED]> wrote: > Does anyone else feel that unittesting is too much work? Not in general, > just the official unittest module for small to medium sized projects? > > It seems easier to write some quick methods that are used when needed > rather than building a program w

Re: Starting a thread before wxPython bootup ... interesting.

2007-10-05 Thread Chris Mellon
On 10/5/07, Shafik <[EMAIL PROTECTED]> wrote: > My apologies for not supplying more info, I am at work and I am > technically not allowed to surf the web for anything. > > I am using Python 2.5.1, the latest wx version (2.8.xx, I dont recall > exactly). This is running under windows XP under the l

Re: weakrefs and bound methods

2007-10-08 Thread Chris Mellon
On 10/8/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 08 Oct 2007 04:06:55 +, Michele Simionato wrote: > > > > Hmmm... I'm not sure I understand how a with statement is meant to > > > replace class.__del__ in practice. It seems to me that the two things > > > have different uses. wit

Re: Convert obejct string repr to actual object

2007-10-08 Thread Chris Mellon
On 10/8/07, Tor Erik Sønvisen <[EMAIL PROTECTED]> wrote: > Hi, > > I've tried locating some code that can recreate an object from it's > string representation... > The object in question is really a dictionary containing other > dictionaries, lists, unicode strings, floats, ints, None, and > boolea

Re: pytz has so many timezones!

2007-10-08 Thread Chris Mellon
On 10/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Oct 8, 1:00 pm, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote: > > On Mon, Oct 08, 2007 at 10:41:03AM -0700, [EMAIL PROTECTED] wrote regarding > > Re: pytz has so many timezones!: > > > > > > > > > On Oct 8, 2:32 am, Sanjay <[EMAIL PROTE

Re: Python + Shoutpy + Twisted Locks

2007-10-08 Thread Chris Mellon
On 10/7/07, Michel Albert <[EMAIL PROTECTED]> wrote: > On Oct 6, 4:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > En Fri, 05 Oct 2007 04:55:55 -0300, exhuma.twn <[EMAIL PROTECTED]> escribi?: > > > > > [...] What I found > > > is that "libshout" is blocking, which should be fine as the wh

Re: Memory leak/gc.get_objects()/Improved gc in version 2.5

2007-10-09 Thread Chris Mellon
On 10/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm running a python program that simulates a wireless network > protocol for a certain number of "frames" (measure of time). I've > observed the following: > > 1. The memory consumption of the program grows as the number of frames > I sim

Re: Mixing Python and C classes in a module

2007-10-09 Thread Chris Mellon
On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > Is it possible to mix classes defined in both Python and C in the same > module? Ideally I would like to be able to do: > > from some.module import MyPythonClass, MyCClass > > I guess that would mean that this would look l

Re: List loops

2007-10-09 Thread Chris Mellon
On 10/9/07, Tommy Grav <[EMAIL PROTECTED]> wrote: > Hi everyone, > >I have a list of objects where I have want to do two loops. > I want to loop over the list and inside this loop, work on all > the elements of the list after the one being handled in the outer > loop. I can of course do this wi

Re: Native class methods

2007-10-09 Thread Chris Mellon
On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > Is there an easy way to implement a specific method of a Python class > in C? Like a native method in Java? I would really like to do the > majority of my class code in Python and just do one or two methods > in C. > > S.

Re: Native class methods

2007-10-09 Thread Chris Mellon
On 09 Oct 2007 17:45:12 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > > On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > > > Is there an easy way to implem

Re: pytz has so many timezones!

2007-10-09 Thread Chris Mellon
On 10/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Why aren't they separated by 30minutes, or 20, or 10? Or 2 hours? > > Why isn't an hour defined to be 30 minutes? > > > Or why don't we have a global time? > > Like UTC? > > > > > Your 25 timezones are an abstraction the same way > > Not

Re: RuntimeWarning: tp_compare

2007-10-09 Thread Chris Mellon
On 10/9/07, Bruno Barberi Gnecco <[EMAIL PROTECTED]> wrote: > I'm getting the following exception when I call an external extension > (pytst): > > /usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return > -1 or -2 for > exception >return _active[_get_ident()] > Tr

Re: storing meta data on dictionary keys

2007-10-09 Thread Chris Mellon
On 10/9/07, Andreas Kraemer <[EMAIL PROTECTED]> wrote: > > I sometimes find it useful to store meta data on dictionary keys, like in > the following example: > > class Dict(dict): > def __init__(self,*args,**kw): > self.key_dict = {} > super(Dict,self).__init__(*args,**kw) > def __setit

Re: Finding Peoples' Names in Files

2007-10-11 Thread Chris Mellon
On 10/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Oct 11, 12:49 pm, Matimus <[EMAIL PROTECTED]> wrote: > > On Oct 11, 9:11 am, brad <[EMAIL PROTECTED]> wrote: > > > > > > > > > [EMAIL PROTECTED] wrote: > > > > However...how can you know it is a name... > > > > > OK, I admitted in my fi

Re: Finding Peoples' Names in Files

2007-10-11 Thread Chris Mellon
On 10/11/07, brad <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > > In case you're doing this for PCI validation, be aware that just the > > CC number is considered sensitive and you'd get some false negatives > > if you filter on anything except th

Re: problem with wxPanel derivation class

2007-10-11 Thread Chris Mellon
On 10/11/07, <"@bag.python.org <"none> wrote: > wxGlade created a simple Frame with a panel a sizer and 3 wxControls , > saticText, TextCtrl, and a Button. > > It seems as though the complaint is that a 'wxWindow *' is expected, > 'Panel' is received > However, Panel IS a wx.Panel derivative whi

Re: problem with wxPanel derivation class ~ thanks

2007-10-12 Thread Chris Mellon
On 10/12/07, <"@bag.python.org <"none> wrote: > none wrote: > > wxGlade created a simple Frame with a panel a sizer and 3 wxControls , > Thanks All, > I didn't make the super() call (java terminology) > to the base class. > > this is the only python group (en) on giganews, my first search > no

Re: Declarative properties

2007-10-12 Thread Chris Mellon
On 10/12/07, Dan Stromberg <[EMAIL PROTECTED]> wrote: > On Fri, 12 Oct 2007 09:42:28 +0200, Bruno Desthuilliers wrote: > > >>> So what? Otherwise you carry *always* the baggage of a public > >>> property and a private attribute whether you need this or not. At > >>> least for me it would be unnec

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-15 Thread Chris Mellon
On 10/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 15 Oct 2007 13:13:48 +0200, paul wrote: > > > Dmitri O.Kondratiev schrieb: > >> Gary, thanks for lots of info! > >> Python strings are not lists! I got it now. That's a pity, I need two > >> different functions: one to reverse a list

Re: re.sub

2007-10-16 Thread Chris Mellon
On 10/16/07, Massimo Di Pierro <[EMAIL PROTECTED]> wrote: > Even stranger > > >>> re.sub('a', '\\n','bab') > 'b\nb' > >>> print re.sub('a', '\\n','bab') > b > b > You called print, so instead of getting an escaped string literal, the string is being printed to your terminal, which is printing th

Re: Problem of Readability of Python

2007-10-17 Thread Chris Mellon
On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Oct 7, 10:24 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > > $ python -mtimeit -s'class A(object):pass' -s'a=A()' 'a.zop=23' > > When I know that all instances of classes inheriting from object have > a namespace, then I would expect e

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Chris Mellon
On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote: > I was thinking of a way I could make writing Python Class Files a > little less painful. I was considering a Ptyhon script that read a > file with a list of property names and method names and then generated > a skeleton class file. > > I

Re: Automatic Generation of Python Class Files

2007-10-22 Thread Chris Mellon
On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote: > On Oct 22, 10:26 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 10/22/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > I was t

Re: Dealing with "funny" characters

2007-10-22 Thread Chris Mellon
On 10/20/07, John Nagle <[EMAIL PROTECTED]> wrote: > Gert-Jan wrote: > > sophie_newbie schreef: > >> Hi, I want to store python text strings that characters like "é" "Č" > >> in a mysql varchar text field. Now my problem is that mysql does not > >> seem to accept these characters. I'm wondering if

Re: Cross-platform GUI development

2007-10-23 Thread Chris Mellon
On 10/23/07, maco <[EMAIL PROTECTED]> wrote: > On Oct 13, 12:34 am, Michael L Torrie <[EMAIL PROTECTED]> wrote: > > Alexandre Badez wrote: > > > Personnaly, I use PyQt simply because I prefere Qt to Gtk, witch is > > > much more integrated with all desktop than Gtk. > > > In fact, your application

Re: Cross-platform GUI development

2007-10-25 Thread Chris Mellon
On 10/24/07, bramble <[EMAIL PROTECTED]> wrote: > On Oct 23, 2:59 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > On 10/23/07, maco <[EMAIL PROTECTED]> wrote: > > > > > > > On Oct 13, 12:34 am, Michael L Torrie <[EMAIL PROTECTED]> w

Re: about functions question

2007-10-25 Thread Chris Mellon
On 10/25/07, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-10-25, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: > > The canonical case for small scripts is to have first all > > functions and globals defined, then the main code protected by > > a guard, ie: > > There's no reason to "protect"

Re: Bypassing __getattribute__ for attribute access

2007-10-25 Thread Chris Mellon
On Thu, 2007-10-25 at 23:13 +0200, Bruno Desthuilliers wrote: > > The logical next question then is how does one best add a new method > > to this class so that future references to x.set_x() and X.set_x will > > properly resolve? It seems the answer would be to somehow add to > > X.__dict__ a

Re: Going past the float size limits?

2007-10-26 Thread Chris Mellon
On 10/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello all > It would be great if I could make a number that can go beyond current > size limitations. Is there any sort of external library that can have > infinitely huge numbers? Way way way way beyond say 5x10^350 or > whatever it is? >

Re: Automatic Generation of Python Class Files

2007-10-30 Thread Chris Mellon
On Oct 30, 2007 5:52 AM, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Oct 29, 11:35 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > > Fuzzyman wrote: > > > On Oct 22, 6:43 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > > >> # Inherit from object. There's no reason to create old-style classes. > > > >

Re: why did these companies choose Tcl over Python

2007-10-31 Thread Chris Mellon
On Oct 31, 2007 2:01 PM, chewie54 <[EMAIL PROTECTED]> wrote: > On Oct 31, 3:06 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > > chewie54 <[EMAIL PROTECTED]> wrote: > > > > >As an electronics engineer I use some very expensive EDA CAD tool > > >programs that are scriptable using Tcl. I was wondering

Re: 3 number and dot..

2007-10-31 Thread Chris Mellon
On Oct 31, 2007 3:24 PM, Abandoned <[EMAIL PROTECTED]> wrote: > On Oct 31, 10:18 pm, Paul McNett <[EMAIL PROTECTED]> wrote: > > Abandoned wrote: > > > Hi.. > > > I want to do this: > > > for examle: > > > 12332321 ==> 12.332.321 > > > > > How can i do? > > > > Assuming that the dots are always in t

Re: setting variables in outer functions

2007-10-31 Thread Chris Mellon
On Oct 31, 2007 5:49 PM, Dustan <[EMAIL PROTECTED]> wrote: > On Oct 31, 7:08 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > > > Dustan <[EMAIL PROTECTED]> wrote: > > > On Oct 30, 11:29 am, Duncan Booth <[EMAIL PROTECTED]> > > > wrote: > > >> Neil Cerutti <[EMAIL PROTECTED]> wrote: > > >> > It's allo

Re: A Python 3000 Question

2007-10-31 Thread Chris Mellon
On Oct 31, 2007 6:02 PM, George Sakkis <[EMAIL PROTECTED]> wrote: > On Oct 31, 6:13 pm, Steven D'Aprano > > > What you have measured is a local optimization that is only useful when > > you have a tight loop with lots of calls to the same len(): > > > > Len = sequence.__len__ > > while Len() < 1000

<    1   2   3   4   5   6   >