RE: What do list comprehensions do that generator expressions don't?

2005-04-25 Thread Mark English
> Date: Mon, 25 Apr 2005 08:51:17 -0500 > From: Mike Meyer <[EMAIL PROTECTED]> > Which means that the real rule should be always use generator expressions, > unless you *know* the expression will always fit in memory. > Which leads to the obvious question of why the exception. >>> l = [(1, 2), (

Importing package modules from C-extension

2005-03-17 Thread Mark English
Basic problem: If there is a C-extension module in a package and it tries to import another python module in the same package without using the fully qualified path, the import fails. Config: Python 2.4 on Windows 2000 For example: mypackage contains: cextension_example.pyd to_be_imported.py

Re: check if object is number

2005-02-14 Thread Mark English
Not sure if anyone's mentioned this yet, but just in case they haven't: Start bit o' Python >>> import operator >>> operator.isNumberType(1) True >>> operator.isNumberType(1.01) True >>> operator.isNumberType('a') False >>> operator.isNumberType('1') False End bit o' Python Have

Re: threading.py Condition wait overflow error

2005-01-26 Thread Mark English
> Date: Wed, 26 Jan 2005 00:10:31 -0500 > From: Tim Peters <[EMAIL PROTECTED]> > The most common cause for "impossible exceptions" > is flawed C code in an extension that fails to > check a Python C API call for an error return. Yes, I use a lot of C modules which I wrote. It could certainly be on

threading.py Condition wait overflow error

2005-01-25 Thread Mark English
Every once in a while since I moved to Python 2.4 I've been seeing the following exception in threading.py Condition: File "mctest3.py", line 1598, in WaitForMessages self.condResponses.wait(1.0) File "C:\Program Files\Python24\lib\threading.py", line 221, in wait delay = min(delay * 2

RE: Class introspection and dynamically determining function arguments

2005-01-24 Thread Mark English
Thanks for the pointers to traits, BasicProperty, and harold fellermann's sample code... --- The information contained in this e-mail is confidential and solely for the intended addressee(s). Unauthorised reproduction, disclosur

RE: Class introspection and dynamically determining function arguments

2005-01-21 Thread Mark English
Diez B. Roggisch wrote: > According to this > http://www-106.ibm.com/developerworks/library/l-pyint.html > > not really - and there are no special moduls neccessary, as > everything is at your hands using __dict__ and so on. Thanks for the link. I'd read that article but found it was too introd

RE: Class introspection and dynamically determining function arguments

2005-01-21 Thread Mark English
> From: "Mark English" <[EMAIL PROTECTED]> > > I'd like to write a Tkinter app which, given a class, pops up a > window(s) with fields for each "attribute" of that class. The > user could enter values for the attributes and on closing the > windo

Class introspection and dynamically determining function arguments

2005-01-20 Thread Mark English
I'd like to write a Tkinter app which, given a class, pops up a window(s) with fields for each "attribute" of that class. The user could enter values for the attributes and on closing the window would be returned an instance of the class. The actual application I'm interested in writing would eithe

Re: Multithreading tkinter question

2004-12-16 Thread Mark English
> Date: Thu, 16 Dec 2004 11:59:53 GMT > From: "John Pote" <[EMAIL PROTECTED]> > > "Mark English" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Is there a safe way to run tkinter in a multithreaded app > where the mainloop ru

Multithreading tkinter question

2004-12-15 Thread Mark English
Is there a safe way to run tkinter in a multithreaded app where the mainloop runs in a background thread ? Here's some test code demonstrating the problem. I'm running Python2.4 under Windows 2000. Code snip starts- from Tkinter import * def GetTkinterThread(): im

Building Windows debug distribution

2004-12-10 Thread Mark English
I have a Windows build of Python 2.4 core with all the extensions, both debug and release. The release installer is built by msi.py Is there a way to build a debug distribution other than rewriting msi.py ? --- The information co