Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Paul Moore
On 11/30/06, Bill Janssen <[EMAIL PROTECTED]> wrote: > > so no offense in advance. > > Sure, no offense taken. I've seen comments like this before on this > list (recently :-). I think both approaches (interface types and duck > typing) are complicated in different ways. Instinctively, I agree w

Re: [Python-3000] Low-hanging fruit: change interpreter prompt?

2006-12-01 Thread Stefan Behnel
Steven Bethard schrieb: > On 11/29/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> But the >>> prompt is Python's trademark! I always get a warm fuzzy >> feeling when I see it, e.g. in a corner of a slide in a NASA >> presentation. > > I was using ``py>`` for a while. That still gave me a wa

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Guido van Rossum
On 12/1/06, Paul Moore <[EMAIL PROTECTED]> wrote: > On 11/30/06, Bill Janssen <[EMAIL PROTECTED]> wrote: > > > so no offense in advance. > > > > Sure, no offense taken. I've seen comments like this before on this > > list (recently :-). I think both approaches (interface types and duck > > typing

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Bill Janssen
> Instinctively, I agree with Tomer on this issue. But I'm reasonably > relaxed about the matter as long as it's optional. What I'm not sure > about, is if that is the intention. For example, > > class MyMap: > def __getitem__(self, key): ... > def __setitem__(self, key, value)

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Samuele Pedroni
Guido van Rossum wrote: > On 12/1/06, Paul Moore <[EMAIL PROTECTED]> wrote: > >> On 11/30/06, Bill Janssen <[EMAIL PROTECTED]> wrote: >> so no offense in advance. >>> Sure, no offense taken. I've seen comments like this before on this >>> list (recently :-). I think bot

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread tomer filiba
[Bill] > I agree. For instance, the > [k] operation may be implemented by the Container interface generic > implementation, in which case your type might have to have the > Container interface i would still like to understand how object proxying (e.g., weakrefs, RPyC), could work when all/most fr

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Fred L. Drake, Jr.
On Friday 01 December 2006 12:08, tomer filiba wrote: > i would still like to understand how object proxying (e.g., weakrefs, > RPyC), could work when all/most frameworks/libraries would be based on > ABCs. That's a realy problem. zope.interface works hard to deal with proxies, but it probabl

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Guido van Rossum
On 12/1/06, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: > On Friday 01 December 2006 12:08, tomer filiba wrote: > > i would still like to understand how object proxying (e.g., weakrefs, > > RPyC), could work when all/most frameworks/libraries would be based on > > ABCs. > > That's a realy prob

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 10:19 AM 12/1/2006 -0800, Guido van Rossum wrote: >On 12/1/06, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: > > On Friday 01 December 2006 12:08, tomer filiba wrote: > > > i would still like to understand how object proxying (e.g., weakrefs, > > > RPyC), could work when all/most frameworks/li

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Jim Jewett
On 12/1/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i would still like to understand how object proxying (e.g., weakrefs, RPyC), > could work when all/most frameworks/libraries would be based on ABCs. > again, the problem is, your proxy is an instance of ProxyType, that > refers to another, "con

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 01:45 PM 12/1/2006 -0500, Jim Jewett wrote: >Why can't your proxy be a derived class that claims to inherit >from those same base classes, but just happens to override all the >methods (and attributes). Because that means you can't use generic proxy objects (e.g. zope.proxy or ProxyTypes). Lu

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Bill Janssen
Samuele Pedroni writes: > Also the built-in types are concrete types, which tend to maximize > convenience. It's unclear > that they are a good starting point to define interfaces, because of > this maximality. I agree with you on this, Samuele. I don't want to deep-end, and put only one metho

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Bill Janssen
> Because that means you can't use generic proxy objects (e.g. zope.proxy or > ProxyTypes). > > Luckily, however, proxies can lie about their __class__ (since Python 2.3) > and thereby fool isinstance(). My guess is that support for weakrefs and/or RPC proxies (something with which I have a lot

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Guido van Rossum
On 12/1/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 10:19 AM 12/1/2006 -0800, Guido van Rossum wrote: > >On 12/1/06, Fred L. Drake, Jr. <[EMAIL PROTECTED]> wrote: > > > On Friday 01 December 2006 12:08, tomer filiba wrote: > > > > i would still like to understand how object proxying (e.g.,

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Paul Moore
On 12/1/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i would still like to understand how object proxying (e.g., weakrefs, RPyC), > could work when all/most frameworks/libraries would be based on ABCs. I don't think that's what is being proposed, if I understand Guido's response to my post. There

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Bill Janssen
Paul Moore writes: > There is no expectation that all/most (or even > many!) libraries would be based on ABCs. Duck typing would remain the > norm. Although I'm not clear what the value of all this is, if the > resulting ABCs *don't* get used in real code. I'm not sure what it means to base a libr

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 11:52 AM 12/1/2006 -0800, Bill Janssen wrote: >Paul Moore writes: > > There is no expectation that all/most (or even > > many!) libraries would be based on ABCs. Duck typing would remain the > > norm. Although I'm not clear what the value of all this is, if the > > resulting ABCs *don't* get use

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Bill Janssen
> I would actually hope that library implementors would shift to using > generic functions, since then they can just document what the function(s) > are supposed to do, and people can just add methods to those functions for > any object types they like, without needing to subclass anything, or h

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Guido van Rossum
On 12/1/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 11:52 AM 12/1/2006 -0800, Bill Janssen wrote: > >Paul Moore writes: > > > There is no expectation that all/most (or even > > > many!) libraries would be based on ABCs. Duck typing would remain the > > > norm. Although I'm not clear what the

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread tomer filiba
[Phillip] > Luckily, however, proxies can lie about their __class__ (since Python 2.3) > and thereby fool isinstance(). yes, well, you try to override __class__ when the real class is actually in a different process :) types compare by ID, so when a proxy is created for an object in another proce

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 01:41 PM 12/1/2006 -0800, Bill Janssen wrote: >And adding GFs does not give us a coherent ability to do type >introspection, which I think would help. Again, I seem to need to >look at values *returned* from calls as much as I worry about the type >of parameters passed into my functions. GFs w

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 01:46 PM 12/1/2006 -0800, Guido van Rossum wrote: >I'm not sure what you mean this. Are you proposing that a library >function that might take a mapping would be rewritten as a generic >library function with one implementation that takes a mapping? Or are >you proposing that the library function

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 12:02 AM 12/2/2006 +0200, tomer filiba wrote: >i'm +1 on that, but still, as Guido (and others) said, you need a way to >differentiate a sequence from a mapping, or a list from a string. dispatching >based on *concrete types*, i.e., isinstance(x, dict), is bad, as it means >users *must derive* f

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Bill Janssen
> Actually, to me the thing that's a stretch from current practice is the > attempt to spell out in detail what a "mapping" is. Good point :-). Of course, that's the problem I'd like to see fixed -- not knowing what a mapping is, or whether a particular value is one. > I'm not saying there is n

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Greg Ewing
Paul Moore wrote: > There is no expectation that all/most (or even > many!) libraries would be based on ABCs. Duck typing would remain the > norm. But even if there are only a few things that don't honour duck typing, it will have an effect on everyone, because there will always be some anxiety th

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Greg Ewing
tomer filiba wrote: > when a proxy is created for an object in another > process, you can only set __class__ to a *proxy* to the remote type... > so isinstance fails. But the class being passed to isinstance() can only be a proxy to the remote class as well, so as long as it's the same proxy that

Re: [Python-3000] iostack and Oh Oh

2006-12-01 Thread Phillip J. Eby
At 05:47 PM 12/1/2006 -0800, Bill Janssen wrote: > > Actually, to me the thing that's a stretch from current practice is the > > attempt to spell out in detail what a "mapping" is. > >Good point :-). Of course, that's the problem I'd like to see fixed >-- not knowing what a mapping is, or whether

[Python-3000] GF dispatch code in C++

2006-12-01 Thread Talin
I'm not sure anyone would be interested in this or not. A few months back, I wrote a generic function dispatcher based on the Chambers/Chen paper for my embedded mini-language, Saga. It's written in C++, although it makes fairly minimal use of C++ features. This code is an independent creation