Re: [Python-3000] Combined configparse + optparse (interest?)

2007-12-10 Thread Neal Becker
Neal Becker wrote: > Right now we have 2 rather different stdlib modules for parsing options > from > ini-style files and from command line. I believe it would be desirable to > have one module that can handle both. Is there interest in pursuing this > idea? Can python learn from c++? Maybe so

Re: [Python-3000] Method descriptors

2007-12-10 Thread Christian Heimes
Guido van Rossum wrote: > I guess there's no such egneric wrapper in the core because the use > case hasn't presented itself before -- or nobody thought of creating a > generic solution. > > It's also possible that in the past this was done using unbound > methods -- so perhaps their removal from

Re: [Python-3000] Method descriptors

2007-12-10 Thread Guido van Rossum
On Dec 10, 2007 2:57 PM, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote: > Dnia 10-12-2007, Pn o godzinie 11:01 -0800, Guido van Rossum pisze: > > > Add a __get__ (instance) method to f's class, and store f directly in > > A. Your __get__ method should return a bound object using > > PyMethod_

Re: [Python-3000] Method descriptors

2007-12-10 Thread Marcin ‘Qrczak’ Kowalczyk
Dnia 10-12-2007, Pn o godzinie 11:01 -0800, Guido van Rossum pisze: > Add a __get__ (instance) method to f's class, and store f directly in > A. Your __get__ method should return a bound object using > PyMethod_New(f, a). Thank you, but I can't do this, because I want a generic mechanism which wo

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Guido van Rossum
FWIW I just modified decimal to import numbers and made Decimal inherit from Inexact and Real. No impact whatsoever. --Guido On Dec 10, 2007 1:38 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Paul Moore wrote: > > On 10/12/2007, Jim Jewett <[EMAIL PROTECTED]> wrote: > > > >>"Don't import module X j

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Greg Ewing
Paul Moore wrote: > On 10/12/2007, Jim Jewett <[EMAIL PROTECTED]> wrote: > >>"Don't import module X just for me, but *if* someone else imports it, >>then I want to do these things to/with it." > > That sounds to me exactly like the registration use case Christian mentioned: > > Register decimal.

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Christian Heimes
Phillip J. Eby wrote: > The "Importing" package implements callbacks as an extension of lazy > imports, but it isn't the only way to do it. Christian's patch > implements callbacks without lazy importing, although I think it still > needs a hook (such as his previously-proposed '__lazy__' attribut

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Phillip J. Eby
At 11:41 AM 12/10/2007 -0500, Jim Jewett wrote: >Is there an example where you would use post-import hooks even though >the system didn't support lazy import? The best I can come up with is >"Don't import module X just for me, but *if* someone else imports it, >then I want to do these things to/wi

[Python-3000] tet_docxmlrpc.py broken in py3k branch

2007-12-10 Thread Guido van Rossum
Can someone fix the test_docxmlrpc.py brokenness in py3k? It seems to have been merged in without any editing. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/ma

Re: [Python-3000] Reconsider repr(0.1) == '0.10000000000000001'

2007-12-10 Thread Noam Raphael
Ok, I wrote a patch! http://bugs.python.org/issue1580 Now you have: >>> 1.1 1.1 It works! And it passes the test suite! I added a test which takes a list of about a 1000 floating point numbers which were designed to check binary to decimal conversion. It turns out that Tcl implemented this algo

Re: [Python-3000] Reconsider repr(0.1) == '0.10000000000000001'

2007-12-10 Thread Guido van Rossum
On Dec 9, 2007 6:29 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Georg Brandl" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Terry Reedy schrieb: > | > It seems your real problem is that repr() rather than str() is applied > | > within collections. (I am not sure exactly why

Re: [Python-3000] Method descriptors

2007-12-10 Thread Guido van Rossum
On Dec 8, 2007 9:45 AM, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote: > I'm confused about storing methods in class dictionaries from the point > of view of the C API. > > 1. Let's say that I have a callable PyObject called f, of my type >defined in C. I want to store something derived f

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Paul Moore
On 10/12/2007, Jim Jewett <[EMAIL PROTECTED]> wrote: > Is there an example where you would use post-import hooks even though > the system didn't support lazy import? The best I can come up with is > "Don't import module X just for me, but *if* someone else imports it, > then I want to do these thi

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Jim Jewett
On 12/10/07, Christian Heimes <[EMAIL PROTECTED]> wrote: > Jim Jewett wrote: > > I had thought that wouldn't be run until the module was otherwise > > loaded. Are you saying that just creating the callback forces a load > > under lazy loading, but not under post-load hooks? > I was saying that t

Re: [Python-3000] Interest in PEP for callbacks on module import

2007-12-10 Thread Christian Heimes
Jim Jewett wrote: > I had thought that wouldn't be run until the module was otherwise > loaded. Are you saying that just creating the callback forces a load > under lazy loading, but not under post-load hooks? The imp.imported (or whatever we name the method) is the register method for the post

[Python-3000] poss bug in IDLE 30a1 in Python 30a2

2007-12-10 Thread Mark Summerfield
Hi, When I start IDLE I get this: Python 3.0a2 (r30a2:59382, Dec 10 2007, 14:21:37) [GCC 4.1.2 20070626 (Red Hat 4.1.2-13)] on linux2 Type "copyright", "credits" or "license()" for more information. Personal firewall softw