Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread skip
>> This sounds sort of like the situation that existed with sys.exitfunc >> before the creation of the atexit module. Can't we develop an API >> similar to that so that many different event-loop-wanting packages >> can play nice together? Greg> I can't see how that would help

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread Greg Ewing
Michiel Jan Laurens de Hoon wrote: > I have an extension module for scientific visualization. This extension > module opens one or more windows, in which plots can be made. What sort of windows are these? Are you using an existing GUI toolkit, or rolling your own? > For the graphics windows to

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > This sounds sort of like the situation that existed with sys.exitfunc before > the creation of the atexit module. Can't we develop an API similar to that > so that many different event-loop-wanting packages can play nice together? I can't see how that would help. If th

Re: [Python-Dev] Inconsistent behaviour in import/zipimport hooks

2005-11-11 Thread João Paulo Silva
Hi (first post here, note that English is not my native language), One thing we shoudn't forgot is that Osvaldo is porting Python to a plataform that has not so much disk space. He needs Python modules with just the essencial. I like ideias like __debug__ opcode, but in Osvaldo use case, there are

Re: [Python-Dev] indented longstrings?

2005-11-11 Thread Bob Ippolito
On Nov 10, 2005, at 1:26 AM, Avi Kivity wrote: > Python's longstring facility is very useful, but unhappily breaks > indentation. I find myself writing code like http://docs.python.org/lib/module-textwrap.html -bob ___ Python-Dev mailing list Python-

Re: [Python-Dev] Weak references: dereference notification

2005-11-11 Thread Greg Ewing
Gustavo J. A. M. Carneiro wrote: > The object isn't really destroyed. Simply ob_refcnt drops to zero, > then tp_dealloc is called, which is supposed to destroy it. But since I > wrote tp_dealloc, I choose not to destroy it, Be aware that a C subclass of your wrapper that overrides tp_dealloc

Re: [Python-Dev] indented longstrings?

2005-11-11 Thread skip
Avi> Python's longstring facility is very useful, but unhappily breaks Avi> indentation. I find myself writing code like Avi> msg = ('From: %s\r\n' Avi>+ 'To: %s\r\n' Avi>+ 'Subject: Host failure report for %s\r\n' Avi>+ 'Date: %s\r\

[Python-Dev] (no subject)

2005-11-11 Thread Sokolov Yura
> > >Mixing Decimal and float is nearly ALWAYS a user error. Doing it correctly >requires significant expertise in the peculiarities of floating point >representations. > So that I think user should declare floats explicitly (###.###f) - he will fall into float space only if he wish it. >So Pyt

[Python-Dev] indented longstrings?

2005-11-11 Thread Avi Kivity
Python's longstring facility is very useful, but unhappily breaks indentation. I find myself writing code like msg = ('From: %s\r\n' + 'To: %s\r\n' + 'Subject: Host failure report for %s\r\n' + 'Date: %s\r\n' + '\r\n' + '%s\r\n') % (

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread skip
Michiel> 1) What if the user decides to import Tkinter next? Tkinter Michiel>notices that PyOS_InputHook is already set, and does not Michiel>reset it to its own event loop. Hence, Tkinter's events are Michiel>not handled. Similarly, if a user imports Tkinter before my

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread Fredrik Lundh
Jim Jewett wrote: > > really? Python comes with a module that makes it trivial to get > > a fully working interpreter console ... > > Using an event loop (or an external GUI) should not require > forking the entire interactive mode, no matter how trivial that > fork is. repeating a bogus argumen

[Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread Jim Jewett
>> (6) Mark Hammond suggests that it might be easier to >> replace the interactive portions of python based on the >> "code" module. matplotlib suggests using ipython >> instead of standard python for similar reasons. >> If that is really the simplest answer (and telling users >> which IDE to us

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter - Summary attempt

2005-11-11 Thread Fredrik Lundh
Jim Jewett wrote: > (6) Mark Hammond suggests that it might be easier to > replace the interactive portions of python based on the > "code" module. matplotlib suggests using ipython > instead of standard python for similar reasons. > > If that is really the simplest answer (and telling users > w

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter

2005-11-11 Thread Michiel Jan Laurens de Hoon
Martin v. Löwis wrote: >Before trying to explain the reason, please try to explain the >problem first. What is it *really* that you want to do which >you feel you currently can't do? > > Probably I should have started the discussion with this; sorry if I confused everybody. But here it is: I h

Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter - Summary attempt

2005-11-11 Thread Michiel Jan Laurens de Hoon
I think this is an excellent summary of the discussion so far. Probably clearer than my own posts. Thanks, Jim! --Michiel. Jim Jewett wrote: >There has been enough misunderstanding in this thread >that the summarizers are going to have trouble. So I'm >posting this draft in hopes of clarificat

Re: [Python-Dev] Inconsistent behaviour in import/zipimport hooks

2005-11-11 Thread Guido van Rossum
On 11/11/05, Ulrich Berning <[EMAIL PROTECTED]> wrote: > Guido, if it was intentional to separate slightly different generated > bytecode into different files and if you have good reasons for doing > this, why have I never seen a .pyoo file :-) Because -OO was an afterthought and not implemented b

[Python-Dev] Event loops, PyOS_InputHook, and Tkinter - Summary attempt

2005-11-11 Thread Jim Jewett
There has been enough misunderstanding in this thread that the summarizers are going to have trouble. So I'm posting this draft in hopes of clarification; please correct me. (1) There is some pre-discussion attached to patches 1049855 and 1252236. Martin Loewis and Michiel de Hoon agreed that t

[Python-Dev] Inconsistent behaviour in import/zipimport hooks

2005-11-11 Thread Jim Jewett
Ulrich Berning schrieb: [He already has a patch that does much of what is being discussed] > I have also introduced the new flag Py_NoZipImport that > can be activated with -Z at startup. This bypasses the > activation of zipimport I think -Z could be confusing; I would expect it to work more li

Re: [Python-Dev] Inconsistent behaviour in import/zipimport hooks

2005-11-11 Thread Ulrich Berning
Phillip J. Eby schrieb: >At 04:33 PM 11/9/2005 -0800, Guido van Rossum wrote: > > >>On 11/9/05, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >> >> >>>By the way, while we're on this subject, can we make the optimization >>>options be part of the compile() interface? Right now the distutils has