Re: Appending traceback from exception in child thread

2009-05-15 Thread Chris Mellon
On Fri, May 15, 2009 at 1:09 PM, Edd e...@nunswithguns.net wrote: Hi folks, I have a some threadpool code that works like this :    tp = ThreadPool(number_of_threads)    futures = [tp.future(t) for t in tasks] # each task is callable    for f in futures:        print f.value() # -- may

Re: A Twisted Design Decision

2009-01-28 Thread Chris Mellon
On Wed, Jan 28, 2009 at 10:05 AM, koranthala koranth...@gmail.com wrote: On Jan 28, 8:36 pm, Jean-Paul Calderone exar...@divmod.com wrote: On Wed, 28 Jan 2009 06:30:32 -0800 (PST), koranthala koranth...@gmail.com wrote: On Jan 28, 7:10 pm, Jean-Paul Calderone exar...@divmod.com wrote: On

Re: BadZipfile file is not a zip file

2009-01-12 Thread Chris Mellon
On Sat, Jan 10, 2009 at 1:32 PM, webcomm rya...@gmail.com wrote: On Jan 9, 7:33 pm, John Machin sjmac...@lexicon.net wrote: It is not impossible for a file with dummy data to have been handcrafted or otherwise produced by a process different to that used for a real-data file. I knew it was

Re: Slow network?

2009-01-12 Thread Chris Mellon
On Mon, Jan 12, 2009 at 1:13 PM, Laszlo Nagy gand...@shopzeus.com wrote: Hi All, To make the long story short, I have a toy version of an ORB being developed, and the biggest problem is slow network speed over TCP/IP. There is an object called 'endpoint' on both sides, with incoming and

Re: urllib2 - 403 that _should_ not occur.

2009-01-12 Thread Chris Mellon
On Mon, Jan 12, 2009 at 4:34 PM, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Mon, 12 Jan 2009 00:38:20 -0600, Chris Mellon wrote: Why Google would deny access to services by unknown User Agents is beyond me - especially since in most cases User Agents strings

Re: urllib2 - 403 that _should_ not occur.

2009-01-11 Thread Chris Mellon
On Sun, Jan 11, 2009 at 9:05 PM, James Mills prolo...@shortcircuit.net.au wrote: On Mon, Jan 12, 2009 at 12:58 PM, Philip Semanchuk phi...@semanchuk.com wrote: On Jan 11, 2009, at 8:59 PM, James Mills wrote: Hey all, The following fails for me: from urllib2 import urlopen f =

Re: BadZipfile file is not a zip file

2009-01-09 Thread Chris Mellon
On Fri, Jan 9, 2009 at 9:05 AM, webcomm rya...@gmail.com wrote: On Jan 9, 3:46 am, Carl Banks pavlovevide...@gmail.com wrote: The zipfile format is kind of brain dead, you can't tell where the end of the file is supposed to be by looking at the header. If the end of file hasn't yet been

Re: distinction between unzipping bytes and unzipping a file

2009-01-09 Thread Chris Mellon
On Fri, Jan 9, 2009 at 2:32 PM, webcomm rya...@gmail.com wrote: On Jan 9, 3:15 pm, Steve Holden st...@holdenweb.com wrote: webcomm wrote: Hi, In python, is there a distinction between unzipping bytes and unzipping a binary file to which those bytes have been written? The following code

Re: distinction between unzipping bytes and unzipping a file

2009-01-09 Thread Chris Mellon
On Fri, Jan 9, 2009 at 3:08 PM, Chris Mellon arka...@gmail.com wrote: On Fri, Jan 9, 2009 at 2:32 PM, webcomm rya...@gmail.com wrote: On Jan 9, 3:15 pm, Steve Holden st...@holdenweb.com wrote: webcomm wrote: Hi, In python, is there a distinction between unzipping bytes and unzipping

Re: looking for tips on how to implement ruby-style Domain Specific Language in Python

2009-01-07 Thread Chris Mellon
On Wed, Jan 7, 2009 at 9:50 AM, J Kenneth King ja...@agentultra.com wrote: Jonathan Gardner jgard...@jonathangardner.net writes: On Jan 6, 12:24 pm, J Kenneth King ja...@agentultra.com wrote: Jonathan Gardner jgard...@jonathangardner.net writes: On Jan 6, 8:18 am, sturlamolden

Re: Is 3.0 worth breaking backward compatibility?

2008-12-11 Thread Chris Mellon
On Thu, Dec 11, 2008 at 12:21 PM, walterbyrd walterb...@iname.com wrote: On Dec 7, 12:35 pm, Andreas Waldenburger geekm...@usenot.de wrote: Plze. Python 3 is shipping now, and so is 2.x, where x 5. Python 2 is going to be around for quite some time. What is everybody's problem? A

Re: Call by reference in SWIG?

2008-12-11 Thread Chris Mellon
On Thu, Dec 11, 2008 at 9:43 AM, Joe Strout j...@strout.net wrote: On Dec 10, 2008, at 10:19 PM, Nok wrote: I can't get call-by-reference functions to work in SWIG... Python doesn't have any call-by-reference support at all [1], so I'm not surprised that a straight translation of the

Re: Flushing PyQt's Event Queue

2008-12-10 Thread Chris Mellon
On Wed, Dec 10, 2008 at 6:30 AM, ff [EMAIL PROTECTED] wrote: Hi, I am writing an app which models growth of a system over time visually which is activated by button clicks, and when the loop finishes running i dont want any events [mainly clicking on buttons] that happened during the loop to

Re: as keyword woes

2008-12-09 Thread Chris Mellon
On Tue, Dec 9, 2008 at 6:39 AM, Paul Boddie [EMAIL PROTECTED] wrote: On 9 Des, 05:52, alex23 [EMAIL PROTECTED] wrote: From my perspective, it was less the original complaint and more the sudden jump to CPython is dead! The GIL sucks! Academic eggheads! that prompted the comparisons to

Re: as keyword woes

2008-12-04 Thread Chris Mellon
On Wed, Dec 3, 2008 at 11:42 PM, Warren DeLano [EMAIL PROTECTED] wrote: Why was it necessary to make as a reserved keyword? I can't answer for the Python developers as to why they *did* make it a reserved word. But I can offer what I believe is a good reason why it *should* be a reserved

Re: as keyword woes

2008-12-04 Thread Chris Mellon
On Thu, Dec 4, 2008 at 8:45 AM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 04 Dec 2008 20:53:38 +1000, James Mills wrote: Readability of your code becomes very important especially if you're working with many developers over time. 1. Use sensible meaningful names. 2. Don't use

Re: To Troll or Not To Troll

2008-12-04 Thread Chris Mellon
On Thu, Dec 4, 2008 at 1:10 PM, Warren DeLano [EMAIL PROTECTED] wrote: Yet Another Python Troll (the ivory tower reference, as well as the abrupt shift from complaining about keywords to multiprocessing), I have to point out that Python does add new keywords, it has done so in the past, and

Re: To Troll or Not To Troll

2008-12-04 Thread Chris Mellon
On Thu, Dec 4, 2008 at 2:11 PM, Warren DeLano [EMAIL PROTECTED] wrote: I still would have to call your management of the problem considerably into question - your expertise at writing mathematical software may not be in question, but your skills and producing and managing a software product

Re: using private parameters as static storage?

2008-11-14 Thread Chris Mellon
On Thu, Nov 13, 2008 at 10:25 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 14 Nov 2008 13:35:02 +1100, Ben Finney wrote: Instead, it looks like you're falling foul of one of the classic mistakes in the How to ask questions the smart way document: you've got a goal, but you're assuming

Re: using private parameters as static storage?

2008-11-13 Thread Chris Mellon
On Thu, Nov 13, 2008 at 11:16 AM, Joe Strout [EMAIL PROTECTED] wrote: One thing I miss as I move from REALbasic to Python is the ability to have static storage within a method -- i.e. storage that is persistent between calls, but not visible outside the method. I frequently use this for such

Re: Avoiding local variable declarations?

2008-11-13 Thread Chris Mellon
On Thu, Nov 13, 2008 at 2:22 PM, dpapathanasiou [EMAIL PROTECTED] wrote: I have some old Common Lisp functions I'd like to rewrite in Python (I'm still new to Python), and one thing I miss is not having to declare local variables. For example, I have this Lisp function: (defun random-char

Re: Error importing wxPython

2008-11-06 Thread Chris Mellon
On Thu, Nov 6, 2008 at 8:09 AM, [EMAIL PROTECTED] wrote: Hi, I just installed wxPython from http://wxpython.org/download.php. When I import (import wx), I get this error: ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect.

Re: Quality control in open source development

2008-10-08 Thread Chris Mellon
On Wed, Oct 8, 2008 at 10:43 AM, Dave [EMAIL PROTECTED] wrote: With the open source licenses that allow redistribution of modified code, how do you keep someone unaffiliated with the Python community from creating his or her own version of python, and declaring it to be Python 2.6, or maybe

Re: questions from a lost sheep

2008-10-02 Thread Chris Mellon
On Thu, Oct 2, 2008 at 2:22 PM, Joe Strout [EMAIL PROTECTED] wrote: Hi all, I used to by a big Python fan, many years ago [1]. I stopped using it after discovering REALbasic, because my main developmental need is to write desktop applications that are as native as possible on each platform,

Re: Linq to Python

2008-09-24 Thread Chris Mellon
On Wed, Sep 24, 2008 at 2:11 PM, [EMAIL PROTECTED] wrote: sturlamolden: No, because Python already has list comprehensions and we don't need the XML buzzword. LINQ is more than buzzwords. Python misses several of those features. So maybe for once the Python crowd may recognize such C#

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Chris Mellon
On Tue, Aug 26, 2008 at 11:12 AM, Fredrik Lundh [EMAIL PROTECTED] wrote: Martin Marcher wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. are you sure you know what

Re: exception handling in complex Python programs

2008-08-19 Thread Chris Mellon
On Tue, Aug 19, 2008 at 12:19 PM, eliben [EMAIL PROTECTED] wrote: Python provides a quite good and feature-complete exception handling mechanism for its programmers. This is good. But exceptions, like any complex construct, are difficult to use correctly, especially as programs get large.

Re: Graphics Contexts and DCs explanations?

2008-08-19 Thread Chris Mellon
On Tue, Aug 19, 2008 at 1:16 PM, RgeeK [EMAIL PROTECTED] wrote: Experimenting with graphics in an app: it's AUI based with a few panes, one of which has a panel containing a few sizers holding UI elements. One sizer contains a panel that needs some basic line-drawing graphics in it. I use the

Re: benchmark

2008-08-07 Thread Chris Mellon
On Thu, Aug 7, 2008 at 8:12 AM, alex23 [EMAIL PROTECTED] wrote: On Aug 7, 8:08 pm, [EMAIL PROTECTED] wrote: Really how silly can it be when you suggest someone is taking a position and tweaking the benchmarks to prove a point [...] I certainly didn't intend to suggest that you had tweaked

Re: benchmark

2008-08-07 Thread Chris Mellon
On Thu, Aug 7, 2008 at 9:09 AM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 07 Aug 2008 06:12:04 -0700, alex23 wrote: On Aug 7, 8:08 pm, [EMAIL PROTECTED] wrote: Really how silly can it be when you suggest someone is taking a position and tweaking the benchmarks to prove a point [...]

Re: interpreter vs. compiled

2008-08-05 Thread Chris Mellon
On Tue, Aug 5, 2008 at 12:12 PM, castironpi [EMAIL PROTECTED] wrote: On Aug 5, 9:21 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Aug 3, 1:26 am, castironpi [EMAIL PROTECTED] wrote: Which is 12 bytes long and runs in a millisecond. What it does is set a memory address to successive

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-31 Thread Chris Mellon
On Tue, Jul 29, 2008 at 3:37 AM, Carl Banks [EMAIL PROTECTED] wrote: On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote: On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote:

Re: Function References

2008-07-31 Thread Chris Mellon
On Thu, Jul 31, 2008 at 10:27 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Jul 31, 10:47 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: I take the freedom to do so as I see fit - this is usenet... Fine, then keep beating a dead horse by replying to this thread with things that do nobody

Re: x, = y (???)

2008-07-17 Thread Chris Mellon
On Thu, Jul 17, 2008 at 2:55 PM, kj [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED] Erik Max Francis [EMAIL PROTECTED] writes: kj wrote: I just came across an assignment of the form x, = y where y is a string (in case it matters). 1. What's the meaning of the comma in the LHS of the

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-21 Thread Chris Mellon
On Wed, May 21, 2008 at 3:56 PM, Dave Parker [EMAIL PROTECTED] wrote: On May 21, 2:44 pm, Jerry Hill [EMAIL PROTECTED] wrote: My understand is no, not if you're using IEEE floating point. Yes, that would explain it. I assumed that Python automatically switched from hardware floating point

Re: Bug in floating-point addition: is anyone else seeing this?

2008-05-21 Thread Chris Mellon
On Wed, May 21, 2008 at 4:29 PM, Dave Parker [EMAIL PROTECTED] wrote: On May 21, 3:17 pm, Chris Mellon [EMAIL PROTECTED] wrote: If you're going to use every post and question about Python as an opportunity to pimp your own pet language you're going irritate even more people than you have

Re: Thread killing - I know I know!

2008-05-19 Thread Chris Mellon
On Mon, May 19, 2008 at 11:36 AM, Roger Heathcote [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On May 16, 11:40 am, Roger Heathcote [EMAIL PROTECTED] wrote:snip Despite many peoples insistence that allowing for the arbitrary killing of threads is a cardinal sin and although I have no

Re: py3k s***s

2008-04-16 Thread Chris Mellon
On Wed, Apr 16, 2008 at 11:40 AM, Aaron Watters [EMAIL PROTECTED] wrote: On Apr 16, 12:27 pm, Rhamphoryncus [EMAIL PROTECTED] wrote: On Apr 16, 6:56 am, Aaron Watters [EMAIL PROTECTED] wrote: I don't get it. It ain't broke. Don't fix it. So how would you have done the old-style

Re: Rationale for read-only property of co_code

2008-04-02 Thread Chris Mellon
On Wed, Apr 2, 2008 at 2:33 PM, João Neves [EMAIL PROTECTED] wrote: On Apr 2, 5:41 pm, Dan Upton [EMAIL PROTECTED] wrote: The thing I've been wondering is why _is_ it read-only? In what circumstances having write access to co_code would break the language or do some other nasty

Re: Need help calling a proprietary C DLL from Python

2008-03-20 Thread Chris Mellon
On Thu, Mar 20, 2008 at 3:42 PM, Craig [EMAIL PROTECTED] wrote: On Mar 20, 2:38 pm, Craig [EMAIL PROTECTED] wrote: On Mar 20, 2:29 pm, sturlamolden [EMAIL PROTECTED] wrote: On 20 Mar, 19:09, Craig [EMAIL PROTECTED] wrote: The culprit i here: Before - X = 0, CacheSize =

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Chris Mellon
On Tue, Mar 18, 2008 at 12:30 PM, sturlamolden [EMAIL PROTECTED] wrote: On 18 Mar, 17:48, Miki [EMAIL PROTECTED] wrote: Apart from PIL, some other options are: 1. Most GUI frameworks (wxPython, PyQT, ...) give you a canvas object you can draw on Yes, but at least on Windows you will

Re: wxPython graphics query (newbie)

2008-03-17 Thread Chris Mellon
On Mon, Mar 17, 2008 at 7:03 AM, Thomas G [EMAIL PROTECTED] wrote: I am exploring wxPython and would be grateful for some help. It is important to me to be able to slide words and shapes around by dragging them from place to place. I don't mean dragging them into a different window, which

Re: Attribute Doesnt Exist ... but.... it does :-s

2008-03-13 Thread Chris Mellon
On Thu, Mar 13, 2008 at 10:36 AM, Robert Rawlins [EMAIL PROTECTED] wrote: Hello Guys, I've got an awfully aggravating problem which is causing some substantial hair loss this afternoon J I want to get your ideas on this. I am trying to invoke a particular method in one of my classes,

Re: wxPython/wxWidgets ok for production use ?

2008-03-11 Thread Chris Mellon
On Tue, Mar 11, 2008 at 11:01 AM, Stefan Behnel [EMAIL PROTECTED] wrote: Sion Arrowsmith wrote: And before you blame wx* for crashes: what platform was this on? Because my experience was that wx on GTK was significantly more prone to glitches than on Windows (through to wxglade being

Re: Obtaining the PyObject * of a class

2008-03-11 Thread Chris Mellon
On Tue, Mar 11, 2008 at 12:13 PM, Terry Reedy [EMAIL PROTECTED] wrote: Cooper, Andrew [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Are there any Python C API experts/SWIG experts out there that can help | me with this issue please. | I',m currently using SWIG to generate

Re: I cannot evaluate this statement...

2008-03-07 Thread Chris Mellon
On Fri, Mar 7, 2008 at 2:38 PM, waltbrad [EMAIL PROTECTED] wrote: The script comes from Mark Lutz's Programming Python. It is the second line of a script that will launch a python program on any platform. import os, sys pyfile = (sys.platform[:3] == 'win' and 'python.exe') or 'python'

Re: Want - but cannot get - a nested class to inherit from outer class

2008-03-07 Thread Chris Mellon
On Fri, Mar 7, 2008 at 3:00 PM, DBak [EMAIL PROTECTED] wrote: I want - but cannot get - a nested class to inherit from an outer class. (I searched the newsgroup and the web for this, couldn't find anything - if I missed an answer to this please let me know!) I would like to build a class

Re: What does this bogus code in urlparse do?

2008-02-26 Thread Chris Mellon
On Mon, Feb 25, 2008 at 11:04 PM, John Nagle [EMAIL PROTECTED] wrote: See http://svn.python.org/view/python/trunk/Lib/urlparse.py?rev=60163view=markup; Look at urljoin. What does the code marked # XXX The stuff below is bogus in various ways... do? I think it's an attempt to remove

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Chris Mellon
On Fri, Feb 22, 2008 at 4:56 AM, Nicola Musatti [EMAIL PROTECTED] wrote: On Feb 22, 12:24 am, Carl Banks [EMAIL PROTECTED] wrote: On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote: There are other downsides to garbage collection, as the fact that it makes it harder to

Re: advanced usage of python threads

2008-02-22 Thread Chris Mellon
On Fri, Feb 22, 2008 at 12:32 PM, hyperboreean [EMAIL PROTECTED] wrote: Well, I will be writing the application server of a three-tier architecture system. I will be using Twisted for the communication with the client but from there I have to make several calls to a database and this asks

Re: The big shots

2008-02-20 Thread Chris Mellon
On Tue, Feb 19, 2008 at 5:31 PM, Diez B. Roggisch [EMAIL PROTECTED] wrote: May I insist? By the criteria you've mentioned so far, nothing rules out 'ext'. If it's still a bad idea, there's a reason. What is it? You imply that just because something is somehow working and even useful

Re: how to find current working user

2008-02-11 Thread Chris Mellon
On Feb 11, 2008 12:30 PM, Gabriel Genellina [EMAIL PROTECTED] wrote: En Mon, 11 Feb 2008 15:21:16 -0200, Praveena Boppudi (c) [EMAIL PROTECTED] escribi�: Can anyone tell me how to find current working user in windows? If it is just informational, use os.environ['USERNAME'] Using win32wnet

Re: Python GUI toolkit

2008-02-04 Thread Chris Mellon
On Feb 4, 2008 9:19 AM, [EMAIL PROTECTED] wrote: Another toolkit you might look into is Tkinter. I think it is something like the official toolkit for python. I also think it is an adapter for other toolkits, so it will use gtk widgets on gnome, qt widgets on kde and some other strange

Re: Python GUI toolkit

2008-02-04 Thread Chris Mellon
On Feb 4, 2008 9:57 AM, Kevin Walzer [EMAIL PROTECTED] wrote: Chris Mellon wrote: Nitpick, but an important one. It emulates *look*. Not feel. Native look is easy and totally insufficient for a native app - it's the feel that's important. Is this opinion based on firsthand experience

Re: Python GUI toolkit

2008-02-04 Thread Chris Mellon
On Feb 4, 2008 10:46 AM, Kevin Walzer [EMAIL PROTECTED] wrote: Chris Mellon wrote: I didn't say inherently unable, I said the toolkit doesn't provide it. Note that you said that you did a lot of work to follow OS X conventions and implement behavior. The toolkit doesn't help you

[issue1757072] Zipfile robustness

2008-02-04 Thread Chris Mellon
Chris Mellon added the comment: I agree that the zipfile is out of spec. Here are my arguments in favor of making the change anyway: Existing zip tools like 7zip, pkzip, and winzip handle these files as expected As far as I know, it won't break any valid zipfiles. Because the fix necessary

Re: Python for mobiles

2008-01-31 Thread Chris Mellon
On Jan 31, 2008 1:16 PM, Shawn Milochik [EMAIL PROTECTED] wrote: A better solution would surely be to get a Nokia S60 'phone, for which there is a native Python implementation. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC

Re: optional static typing for Python

2008-01-29 Thread Chris Mellon
On Jan 28, 2008 10:31 AM, John Nagle [EMAIL PROTECTED] wrote: Arnaud Delobelle wrote: On Jan 27, 11:00 pm, Russ P. [EMAIL PROTECTED] wrote: On Jan 27, 2:49 pm, André [EMAIL PROTECTED] wrote: Perhaps this:http://www.python.org/dev/peps/pep-3107/mightbe relevant? André Thanks. If I read

Re: looking for a light weighted library/tool to write simple GUI above the text based application

2008-01-25 Thread Chris Mellon
On Jan 25, 2008 5:17 PM, Paul Boddie [EMAIL PROTECTED] wrote: On 25 Jan, 22:06, Lorenzo E. Danielsson [EMAIL PROTECTED] wrote: What you need then is something like SVGAlib (http;//svgalib.org). Only really old people like myself know that it exists. I've never heard of any Python

Re: translating Python to Assembler

2008-01-25 Thread Chris Mellon
On Jan 25, 2008 9:09 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Wed, 23 Jan 2008 08:49:20 +0100, Christian Heimes wrote: It's even possible to write code with Python assembly and compile the Python assembly into byte code. Really? How do you do that? I thought it might be

Re: translating Python to Assembler

2008-01-24 Thread Chris Mellon
On Jan 24, 2008 9:14 AM, Bjoern Schliessmann [EMAIL PROTECTED] wrote: Tim Roberts wrote: Bjoern Schliessmann [EMAIL PROTECTED] So, how do processors execute Python scripts? :) Is that a rhetorical question? A little bit. Grant is quite correct; Python scripts (in the canonical

Re: strange syntax rules on list comprehension conditions

2008-01-18 Thread Chris Mellon
On Jan 18, 2008 12:53 PM, Nicholas [EMAIL PROTECTED] wrote: I was quite delighted today, after extensive searches yielded nothing, to discover how to place an else condition in a list comprehension. Trivial mask example: [True if i 5 else False for i in range(10)] # A [True, True,

Re: short path evaluation, why is f() called here: dict(a=1).get('a', f())

2008-01-14 Thread Chris Mellon
On Jan 14, 2008 12:39 PM, aspineux [EMAIL PROTECTED] wrote: This append in both case dict(a=1).get('a', f()) dict(a=1).setdefault('a', f()) This should be nice if f() was called only if required. Think about the change to Python semantics that would be required for this to be true, and

Re: Python too slow?

2008-01-11 Thread Chris Mellon
On Jan 11, 2008 9:10 AM, George Sakkis [EMAIL PROTECTED] wrote: On Jan 11, 8:59 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: George Sakkis a écrit : On Jan 11, 4:12 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: George Sakkis a écrit : On Jan 10, 3:37

Re: Strange problem: MySQL and python logging using two separate cursors

2008-01-11 Thread Chris Mellon
On Jan 9, 2008 11:52 AM, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Wed, 9 Jan 2008 10:11:09 +0100, Frank Aune [EMAIL PROTECTED] declaimed the following in comp.lang.python: The only clue I have so far, is that the cursor in task 1 seems to be unable to register any new entries in the

Re: how to use bool

2008-01-03 Thread Chris Mellon
On 03 Jan 2008 16:09:53 GMT, [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: hi, i have some code where i set a bool type variable and if the value is false i would like to return from the method with an error msg.. being a beginner I wd like some help here class myclass:

Re: reassign to builtin possible !?

2008-01-03 Thread Chris Mellon
On Jan 3, 2008 8:05 AM, Tim Chase [EMAIL PROTECTED] wrote: But you can't alter the values for True/False globally with this. Are you sure ? what about the following example ? Is this also shadowing ? import __builtin__ __builtin__.True = False __builtin__.True False It doesn't

Re: ElementTree should parse string and file in the same way

2008-01-02 Thread Chris Mellon
On Jan 2, 2008 8:56 AM, Fredrik Lundh [EMAIL PROTECTED] wrote: Steven D'Aprano wrote: Fredrik, if you're reading this, I'm curious what your reason is. I don't have an opinion on whether you should or shouldn't treat files and strings the same way. Over to you... as Diez shows, it's all

Re: Bizarre behavior with mutable default arguments

2007-12-31 Thread Chris Mellon
On Dec 31, 2007 2:08 PM, Odalrick [EMAIL PROTECTED] wrote: On 31 Dec, 18:22, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Dec 31, 10:58 am, Odalrick [EMAIL PROTECTED] wrote: On 30 Dec, 17:26, George Sakkis [EMAIL PROTECTED] wrote: On Dec 29, 9:14 pm, bukzor [EMAIL PROTECTED] wrote:

Re: Python DLL in Windows Folder

2007-12-28 Thread Chris Mellon
On Dec 28, 2007 6:41 AM, Ross Ridge [EMAIL PROTECTED] wrote: Ross Ridge writes: As I said before, I know how futile it is to argue that Python should change it's behaviour. I'm not going to waste my time telling you what to do. If you really want to know how side-by-side installation

Re: Python DLL in Windows Folder

2007-12-26 Thread Chris Mellon
On Dec 24, 2007 5:23 PM, Ross Ridge [EMAIL PROTECTED] wrote: Chris Mellon [EMAIL PROTECTED] wrote: What the python installer is doing is the Right Thing for making the standard python dll available to third party applications. Applications that want a specific version of a specific DLL should

Re: Releasing malloc'd memory using ctypes?

2007-12-24 Thread Chris Mellon
On Dec 23, 2007 12:36 PM, [EMAIL PROTECTED] wrote: I am starting to experiment with ctypes. I have a function which returns a pointer to a struct allocated in heap memory. There is a corresponding free function for that sort of struct, e.g.: from ctypes import *

Re: Python DLL in Windows Folder

2007-12-24 Thread Chris Mellon
On Dec 23, 2007 12:27 PM, Markus Gritsch [EMAIL PROTECTED] wrote: On 23/12/2007, Christian Heimes [EMAIL PROTECTED] wrote: Markus Gritsch wrote: why does the Python installer on Windows put the Python DLL into the Windows system32 folder? Wouldn't it be more clean to place it into the

Re: How to in Python

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 7:25 AM, [EMAIL PROTECTED] wrote: John Machin wrote: Use a proper lexer written by somebody who knows what they are doing, as has already been recommended to you. My lexer returns a MALFORMED_NUMBER token on '0x' or '0x '. Try that in Python. Is there some reason that

Re: It's ok to __slots__ for what they were intended (was: Don't use __slots__ (was Re: Why custom objects take so much memory?))

2007-12-21 Thread Chris Mellon
On 20 Dec 2007 19:50:31 -0800, Aahz [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Carl Banks [EMAIL PROTECTED] wrote: On Dec 18, 4:49 pm, [EMAIL PROTECTED] (Aahz) wrote: In article [EMAIL PROTECTED], Chris Mellon [EMAIL PROTECTED] wrote: You can reduce the size of new-style

Re: Beginner question!

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 9:11 AM, SMALLp [EMAIL PROTECTED] wrote: Hy! I have error something like this TypeError: unbound method insert() must be called with insertData instance as first argument (got str instance instead) CODE: File1.py sql.insertData.insert(files, data) sql.py class

Re: How to in Python

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 1:02 PM, [EMAIL PROTECTED] wrote: Chris Mellon wrote: Is there some reason that you think Python is incapable of implementing lexers that do this, just because Python lexer accepts it? Absolutely not. My opinion is that it's a bug. A very, very minor bug, but still six

Re: It's ok to __slots__ for what they were intended

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 2:07 PM, Fredrik Lundh [EMAIL PROTECTED] wrote: John Nagle wrote: I'd like to hear more about what kind of performance gain can be obtained from __slots__. I'm looking into ways of speeding up HTML parsing via BeautifulSoup. If a significant speedup can be obtained

Re: mac dashboad

2007-12-21 Thread Chris Mellon
On Dec 21, 2007 3:25 PM, Carl K [EMAIL PROTECTED] wrote: ianaré wrote: On Dec 21, 12:37 pm, Carl K [EMAIL PROTECTED] wrote: How do I hang an app off the mac dashboard? The goal is a python version of Weatherbug. something like: read xml data from a URL, display some numbers,

Re: Ping Implementation in Python

2007-12-20 Thread Chris Mellon
On Dec 20, 2007 9:41 AM, Mrown [EMAIL PROTECTED] wrote: Hi, I was wondering if there was a ping implementation written in Python. I'd rather using a Python module that implements ping in a platform/OS-independent way than rely on the underlying OS, especially as every OS has a different

Re: wxPython FileDialog, select folder

2007-12-20 Thread Chris Mellon
On Dec 20, 2007 3:19 PM, SMALLp [EMAIL PROTECTED] wrote: How can i select folder either with wx.FileDialog or with any other. I managed to fine only how to open files but I need to select folder to get files from all sub folders. There's a separate dialog, wx.DirDialog. --

Re: Allowing Arbitrary Indentation in Python

2007-12-19 Thread Chris Mellon
On Dec 19, 2007 10:46 AM, Sam [EMAIL PROTECTED] wrote: On Dec 19, 11:09 am, gDog [EMAIL PROTECTED] wrote: Hi, Sam- I'm not wanting to start a flame war, either, but may I ask why does your friend want to do that? I'm always intrigued by the folks who object to the indentation rules in

Re: Allowing Arbitrary Indentation in Python

2007-12-19 Thread Chris Mellon
On Dec 19, 2007 4:05 PM, Gary [EMAIL PROTECTED] wrote: snipped a lot of stuff I'm not replying to Chris Mellon writes: It's interesting that the solutions move away from the terrible abomination of a GUI toolkit and write Python wrappers that don't cause actual physical pain never occur

Re: Changing intobject to use int rather than long

2007-12-18 Thread Chris Mellon
On Dec 18, 2007 11:59 AM, Clarence [EMAIL PROTECTED] wrote: Does anyone think (or know) that it might cause any internal problems if the ival member of the struct defining an intobject were to be changed from its current long int to just int? When you move your application to a 64-bit system

Re: Why custom objects take so much memory?

2007-12-18 Thread Chris Mellon
On Dec 18, 2007 1:26 PM, jsanshef [EMAIL PROTECTED] wrote: Hi, after a couple of days of script debugging, I kind of found that some assumptions I was doing about the memory complexity of my classes are not true. I decided to do a simple script to isolate the problem: class MyClass:

Re: Using 'property' in evolving code

2007-12-17 Thread Chris Mellon
On Dec 17, 2007 11:48 AM, Steven Clark [EMAIL PROTECTED] wrote: Hi all- I was reading http://dirtsimple.org/2004/12/python-is-not-java.html, in particular the part about getters and setters are evil: In Java, you have to use getters and setters because using public fields gives you no

Re: Is Python really a scripting language?

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 2:07 AM, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 13 Dec 2007 10:43:18 +0100, Bruno Desthuilliers [EMAIL PROTECTED] declaimed the following in comp.lang.python: I still wait to see any clear, unambiguous definition of scripting language. Which one are you

Re: Compressing a text file using count of continous characters

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 10:54 AM, nirvana [EMAIL PROTECTED] wrote: I need to count the number of continous character occurances(more than 1) in a file, and replace it with a compressed version, like below XYZDEFAAcdAA -- XYZ8ADEF2Acd2A This sounds like homework. Google for run length

Re: state machine and a global variable

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 10:52 AM, [EMAIL PROTECTED] wrote: Dear list, I'm writing very simple state machine library, like this: _state = None def set_state(state): global _state _state = state def get_state(): print _surface but I hate to use global variable. So, please, is

Re: Is Python really a scripting language?

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 2:09 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Dec 11, 10:34 pm, Terry Reedy [EMAIL PROTECTED] wrote: Ron Provost [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] But here's my problem, most of my coworkers, when they see my apps and learn that they are

Re: state machine and a global variable

2007-12-14 Thread Chris Mellon
On Dec 14, 2007 4:43 PM, [EMAIL PROTECTED] wrote: On Dec 14, 11:06 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : Dear list, I'm writing very simple state machine library, like this: _state = None def set_state(state): global _state

Re: Clearing a DOS terminal in a script

2007-12-13 Thread Chris Mellon
On Dec 13, 2007 10:48 AM, Stephen_B [EMAIL PROTECTED] wrote: This doesn't seem to work in a dos terminal at the start of a script: from os import popen print popen('clear').read() Any idea why not? Thanks. It opens clear with it's own virtual terminal and clears that instead. There's an

Re: Is a real C-Python possible?

2007-12-13 Thread Chris Mellon
On Dec 13, 2007 12:04 PM, Patrick Mullen [EMAIL PROTECTED] wrote: Kay Schluehr wrote: Python 2.6 and 3.0 have a more Pythonic way for the problem: class A(object): @property def foo(self): return self._foo @foo.setter def foo(self,

Re: python vs perl performance test

2007-12-13 Thread Chris Mellon
On Dec 13, 2007 12:11 PM, [EMAIL PROTECTED] wrote: First, let me admit that the test is pretty dumb (someone else suggested it :) but since I am new to Python, I am using it to learn how to write efficient code. my $sum = 0; foreach (1..10) { my $str = chr(rand(128)) x 1024;

Re: do as a keyword

2007-12-12 Thread Chris Mellon
On Dec 11, 2007 2:19 PM, Steven D'Aprano [EMAIL PROTECTED] wrote: On Tue, 11 Dec 2007 15:06:31 +, Neil Cerutti wrote: When I use languages that supply do-while or do-until looping constructs I rarely need them. ... However, did you have an specific need for a do-while construct?

Re: Is a real C-Python possible?

2007-12-12 Thread Chris Mellon
On Dec 12, 2007 8:36 AM, sturlamolden [EMAIL PROTECTED] wrote: On 12 Des, 12:56, George Sakkis [EMAIL PROTECTED] wrote: Ah, the 'make' statement.. I liked (and still do) that PEP, I think it would have an impact comparable to the decorator syntax sugar, if not more. I think it is one

Re: Is a real C-Python possible?

2007-12-12 Thread Chris Mellon
On Dec 12, 2007 12:53 PM, George Sakkis [EMAIL PROTECTED] wrote: On Dec 12, 1:12 pm, Christian Heimes [EMAIL PROTECTED] wrote: Kay Schluehr wrote: class A(object): foo = property: def fget(self): return self._foo def fset(self, value):

Re: After running for four days, Python program stalled

2007-12-12 Thread Chris Mellon
On Dec 12, 2007 1:34 PM, John Nagle [EMAIL PROTECTED] wrote: Had a Python program stall, using no time, after running OK for four days. Python 2.4, Windows. Here's the location in Python where it's stalled. Any idea what it's waiting for? John Nagle 77FA1428

Re: Dumb newbie back in shell

2007-12-11 Thread Chris Mellon
On Dec 11, 2007 8:23 AM, J. Clifford Dyer [EMAIL PROTECTED] wrote: The code you just posted doesn't compile successfully. It *compiles* fine, but it'll raise an error when run. However, in your code, you probably have char_ptr defined at the module level, and you're confused because you

Re: Dumb newbie back in shell

2007-12-11 Thread Chris Mellon
On Dec 11, 2007 8:51 AM, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Chris Mellon a écrit : (snip) What's probably happening is that line_ptr last_line is not true Indeed. and the body of the function isn't executed at all. The unbound local exception is a runtime error that occurs

  1   2   3   4   5   6   >