Re: [Python-3000] Class Decorators + ctypes (Was: yes to class decorators)

2006-11-17 Thread Talin
Greg Ewing wrote: > Talin wrote: >> A different approach would be to say that the class decorator can >> overload the '__setattr__' method on the class itself during class >> creation: > > But it doesn't work that way -- class attributes don't > go through __setattr__ during class creation. They

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Talin
Greg Ewing wrote: > Talin wrote: > >> From my point of view, both 'with' and generator expressions are >> limited, special-case solutions to a general problem - the desire to >> be able to use and manipulate unnamed blocks of code as first-class >> objects. > > I don't think it's as simple as

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Fredrik Lundh
Talin wrote: > I expect to see a series of special-case syntactical work-arounds that > compensate for the lack of such a feature. yeah, because the "special-case syntactical work-arounds" are care- fully designed to be *usable* for a well-defined group of *practical* problems. it's about HCI,

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Paul Moore
On 11/17/06, Talin <[EMAIL PROTECTED]> wrote: > # Create a callback timer > alarm = Timer() > alarm.SetDuration( 100, Timer.Milliseconds ) > > upon alarm: >print "It's time to get up, silly-head!" > > print "Alarm has been set!" Why invent a new special case syntax - t

Re: [Python-3000] native support for multiple dispatch in 3.0 ?

2006-11-17 Thread Fredrik Lundh
Phillip J. Eby wrote: > Only the discussion several months ago, where I tried to show that you > could treat all functions as extensible, by using extensible functions to > define them. /snip many useful references/ thanks. more than enough to keep me busy over the weekend ;-) has anyone loo

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Talin
Fredrik Lundh wrote: > Talin wrote: > >> I expect to see a series of special-case syntactical work-arounds that >> compensate for the lack of such a feature. > > yeah, because the "special-case syntactical work-arounds" are care- > fully designed to be *usable* for a well-defined group of *pract

Re: [Python-3000] upon

2006-11-17 Thread Antoine
> However, this special-case approach is flawed in this example, because > its use is so narrow. If you think about it for a minute, you > immediately start to imagine all of the things that 'upon' ought to deal > with that it doesn't. > For example, it has no way to deal with error > callbacks; A

Re: [Python-3000] Builtin iterator type

2006-11-17 Thread Stefan Behnel
Hi, George Sakkis wrote: > On 11/13/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: >> Are you going to propose similar >> changes for all standard de-facto interfaces, like sequences, >> mappings, files etc.? > > No, I won't (at least not for now ;-)). Notice however that most > user-defined seq

Re: [Python-3000] Class Decorators + ctypes (Was: yes to class decorators)

2006-11-17 Thread Nick Coghlan
Talin wrote: > Greg Ewing wrote: >> Talin wrote: >>> A different approach would be to say that the class decorator can >>> overload the '__setattr__' method on the class itself during class >>> creation: >> But it doesn't work that way -- class attributes don't >> go through __setattr__ during cl

Re: [Python-3000] upon

2006-11-17 Thread Talin
Antoine wrote: >> However, this special-case approach is flawed in this example, because >> its use is so narrow. If you think about it for a minute, you >> immediately start to imagine all of the things that 'upon' ought to deal >> with that it doesn't. >> For example, it has no way to deal with e

Re: [Python-3000] upon

2006-11-17 Thread Fredrik Lundh
"Talin" wrote: > Hmmm, a single syntax that handles both async callbacks, async errors, > and switch/case constructs...maybe this would be more useful than I > thought ... :) done much BASIC programming lately ? ___ Python-3000 mailing list Python

Re: [Python-3000] native support for multiple dispatch in 3.0 ?

2006-11-17 Thread Bob Ippolito
On 11/17/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Phillip J. Eby wrote: > > > Only the discussion several months ago, where I tried to show that you > > could treat all functions as extensible, by using extensible functions to > > define them. > > /snip many useful references/ > > thanks. mo

[Python-3000] Fwd: Python bytes object

2006-11-17 Thread Neil Schemenauer
- Forwarded message from Antti Louko <[EMAIL PROTECTED]> - Date: Fri, 17 Nov 2006 08:25:03 +0200 From: Antti Louko <[EMAIL PROTECTED]> Subject: Python bytes object To: [EMAIL PROTECTED] Python bytes object is useful. I would add bitwise logical operations. They would be most useful in cr

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Robert Brewer
Fredrik Lundh wrote: > it's about HCI, not CS. +1 QOTF. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.p

Re: [Python-3000] Fwd: Python bytes object

2006-11-17 Thread Guido van Rossum
Sounds good to me -- I don't have this need myself but it seems to fit well. I'm looking forward to a patch. :-) On 11/17/06, Neil Schemenauer <[EMAIL PROTECTED]> wrote: > - Forwarded message from Antti Louko <[EMAIL PROTECTED]> - > > Date: Fri, 17 Nov 2006 08:25:03 +0200 > From: Antti Lo

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Terry Reedy
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > *To me* you have this backwards. The function-object creation code is > executed *before* the call that passes that object. This is true whether > it is placed before, as above, or nested within, as you and Tomer pref

Re: [Python-3000] yes to class decorators

2006-11-17 Thread Steven Bethard
On 11/16/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > but here's some abuse that I couldn't help chuckling > over. No need to even bother constructing a class, but don't forget that > 'return locals()' at the end! (not that I'm advocating its [ab]use, > just something that made me smile) > > -

Re: [Python-3000] Builtin iterator type

2006-11-17 Thread Bill Janssen
Greg Ewing wrote: > George Sakkis wrote: > > > And for two, not everyone feels comfortable with duck typing. People > > who consider (for better or for worse) isinstance() safer than > > hasattr()/getattr() would be accomodated too. > > The trouble is that building things into the core to > "acco

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Talin
Fredrik Lundh wrote: > Talin wrote: > >> I expect to see a series of special-case syntactical work-arounds that >> compensate for the lack of such a feature. > > yeah, because the "special-case syntactical work-arounds" are care- > fully designed to be *usable* for a well-defined group of *pract

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Brett Cannon
On 11/17/06, Talin <[EMAIL PROTECTED]> wrote: Fredrik Lundh wrote: > Talin wrote: > >> I expect to see a series of special-case syntactical work-arounds that >> compensate for the lack of such a feature. > > yeah, because the "special-case syntactical work-arounds" are care- > fully designed to

Re: [Python-3000] Fwd: Python bytes object

2006-11-17 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > Sounds good to me -- I don't have this need myself but it seems to fit > well. I'm looking forward to a patch. :-) If I remember correctly, 2.5 was supposed to have binascii.long2b() and binascii.b2long() which would have converted a long integer t

Re: [Python-3000] yes to class decorators

2006-11-17 Thread Nick Coghlan
Steven Bethard wrote: > Of course, this is almost exactly what the class statement does under > the covers. That 'almost' you have there covers some pretty significant differences though. > The important points in the code above are the ``MAKE_FUNCTION`` and > ``CALL_FUNCTION`` from the class sta

Re: [Python-3000] Builtin iterator type

2006-11-17 Thread Greg Ewing
Bill Janssen wrote: > The use of standard base types (interfaces) > is basically a communications mechanism that lets functionality > designers easily tell users of their functionality what's needed. But it's a blunt tool, because it arbitrarily lumps together sets of functionality that often are

Re: [Python-3000] A plea for anonymous functions

2006-11-17 Thread Greg Ewing
Talin wrote: > How is it that > people are so hostile to something that I, and apparently others, find > so useful? I don't think it's hostility so much as a weary feeling that this discussion is revisiting something that's been hashed over many times before with no satisfactory result. If ther

Re: [Python-3000] upon

2006-11-17 Thread Nick Coghlan
Talin wrote: > Hmmm, a single syntax that handles both async callbacks, async errors, > and switch/case constructs...maybe this would be more useful than I > thought ... :) > > Now, can we figure out how to handle arguments to the code block...? PEP 343 already gives you an answer to this quest

Re: [Python-3000] Builtin iterator type

2006-11-17 Thread Bill Janssen
Greg Ewing writes: > > Checking for some textual attributes of a > > type > > Now you're talking about LYBL, which is generally > considered an anti-pattern in Python. APIs should > be designed so that you don't need to test for the > presence of features. So you join me in wanting to make the us