[Python-3000] PEP: Keyword-Only Arguments

2006-04-23 Thread Talin
I've submitted the "Keyword-Only Arguments" PEP that we've been discussing. You can also read it here: http://www.viridia.org/python/doc/PEP_KeywordOnlyArguments.txt -- Talin ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/ma

Re: [Python-3000] Removing __getslice__ et al.

2006-04-23 Thread Guido van Rossum
On 4/23/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Thomas Wouters wrote: > > > > A long-standing part of Py3K is removing 'old style slices' (meaning the > > __get/set/delslice__ methods and the sq_slice/sq_ass_slice sequence-struct > > functions, but not slice objects.) I started removing them,

Re: [Python-3000] Minor hitch writing the Function Signature PEP

2006-04-23 Thread Bill Birch
On Sun, 23 Apr 2006 05:36 am, Talin wrote: > @precondition( y=NotNegative ) > def power( x, y ): >    ... > ...where 'NotNegative' is a function which simply does an assert( value >= 0 ) The phrase "y=NotNegative" is a classic type constraint predicate. Given that type expressions will be dynamic

Re: [Python-3000] Pronouncement on parameter lists

2006-04-23 Thread Baptiste Carvello
Greg Ewing a écrit : > Jim Jewett wrote: > > >>It has not yet been specified what would happen to additional >>positional arguments that get passed in anyway. (Swallow or raise an >>Exception?) > > > I've always intended that there would be an exception. > If so, why not replace the lone star

Re: [Python-3000] Brainstorming: literal construction hooks

2006-04-23 Thread Bill Birch
On Sun, 23 Apr 2006 12:53 am, Fredrik Lundh wrote: > Guido van Rossum wrote: > > It's an interesting idea; it's been brought up before but nobody AFAIK > > has ever implemented it. I like the scoping requirement. > > can we add support for XML literals while we're at it? > > http://effbot.org/z

Re: [Python-3000] Minor hitch writing the Function Signature PEP

2006-04-23 Thread Talin
Bill Birch tpg.com.au> writes: > > On Sun, 23 Apr 2006 05:36 am, Talin wrote: > > precondition( y=NotNegative ) > > def power( x, y ): > >... > > ...where 'NotNegative' is a function which simply does an assert( value >= > 0 ) > The phrase "y=NotNegative" is a classic type constraint pred

Re: [Python-3000] PEP - string.format

2006-04-23 Thread Ian Bicking
Nick Coghlan wrote: > [...] >> The second method, 'fformat', is identical to the first, except that it >> takes an additional first argument that is used to specify a 'custom >> formatter' object, which can override the normal formatting rules for >> specific fields: >> >> "More on {0}, {1}, and {c

Re: [Python-3000] Use Py_CLEAR only

2006-04-23 Thread Martin v. Löwis
Greg Ewing wrote: >> Both should be optimized away by the compiler. > > How? I don't see how the compiler can know either of > those things. As you then discussed: it can do that for local variables (it might even *warn* about the redundant assignment, though). OTOH, for local variables, it might

[Python-3000] Brainstorming: Python Metaprogramming

2006-04-23 Thread Talin
It seems that the history of the Python mailing lists are littered with the decayed corpses of various ideas related to "metaprogramming", that is, programs that write programs, either at compile time. We've seen proposals for C-style macros, Lisp-style macros, programmable syntax (guilty!), AST a

Re: [Python-3000] Brainstorming: Python Metaprogramming

2006-04-23 Thread Ivan Krstic
Talin wrote: > Anyway, I wanted to throw this out there for discussion. I'm mainly interested > in a discussion of ways that we could facilitate additional metaprogramming in > Python, with the tiniest possible changes to the language PEP 3099 contains Guido's explicit pronouncement against this,

[Python-3000] Stackable Blocks

2006-04-23 Thread Crutcher Dunnavant
Having been shot down so hard on my request to bring for loops into symetry with list comprehensions, I have a new proposal - stackable blocks. This is a very _small_ amount of syntax sugar, the basic idea is that any block headers can be stacked on the same line. This changes no semantics, nor do

Re: [Python-3000] Use Py_CLEAR only

2006-04-23 Thread Thomas Wouters
On 4/23/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: For pointer that live on the heap, Py_[X]DECREF is usuallydone because eithera) the memory block containing the pointer is about to be   released (e.g. when a tuple is deallocated), orb) the pointer is about to be changed to point to somethin

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Ivan Krstic
Crutcher Dunnavant wrote: > for file in open_files: if file.readable(): > ... > > for line in open(file): if line.strip(): I don't like this. It looks unclean and adds an exception to the conventional Python rules while yielding no particular or significant benefit. -- Ivan Krstic <[EMAIL PRO

Re: [Python-3000] Pronouncement on parameter lists

2006-04-23 Thread Josiah Carlson
Baptiste Carvello <[EMAIL PROTECTED]> wrote: > > Greg Ewing a écrit : > > Jim Jewett wrote: > > > > > >>It has not yet been specified what would happen to additional > >>positional arguments that get passed in anyway. (Swallow or raise an > >>Exception?) > > > > > > I've always intended that

Re: [Python-3000] Brainstorming: Python Metaprogramming

2006-04-23 Thread Talin
Ivan Krstic fas.harvard.edu> writes: > Talin wrote: > > Anyway, I wanted to throw this out there for discussion. I'm mainly > > interested in a discussion of ways that we could facilitate > > additional metaprogramming in Python, with the tiniest possible changes > > to the language > > PEP 3099

Re: [Python-3000] Type Comparisons with Godel Numbers

2006-04-23 Thread Jim Jewett
On 4/21/06, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > Another (similar) way would be to let the user pay for the high typechecking > price in normal cases *but* provide a list[int] class, which is a list > decorated with typechecks on modification operations. We could have > list[int|float]() to

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Crutcher Dunnavant
On 4/23/06, Ivan Krstic <[EMAIL PROTECTED]> wrote: > Crutcher Dunnavant wrote: > > for file in open_files: if file.readable(): > > ... > > > > for line in open(file): if line.strip(): > > I don't like this. It looks unclean and adds an exception to the > conventional Python rules while yielding n

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Jay Parlar
On Apr 23, 2006, at 5:12 PM, Crutcher Dunnavant wrote: > On 4/23/06, Ivan Krstic <[EMAIL PROTECTED]> wrote: >> Crutcher Dunnavant wrote: >>> for file in open_files: if file.readable(): >>> ... >>> >>> for line in open(file): if line.strip(): >> >> I don't like this. It looks unclean and adds an

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Crutcher Dunnavant
On 4/23/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On Apr 23, 2006, at 5:12 PM, Crutcher Dunnavant wrote: > > > On 4/23/06, Ivan Krstic <[EMAIL PROTECTED]> wrote: > >> Crutcher Dunnavant wrote: > >>> for file in open_files: if file.readable(): > >>> ... > >>> > >>> for line in open(file): if l

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Jay Parlar
On Apr 23, 2006, at 6:32 PM, Crutcher Dunnavant wrote: > On 4/23/06, Jay Parlar <[EMAIL PROTECTED]> wrote: >> >> I think what Ivan meant is that the normal Python rule is that if you >> have a full-colon (ANYWHERE), and you put something after it on the >> same line, then you're done the block. T

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Crutcher Dunnavant
On 4/23/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On Apr 23, 2006, at 6:32 PM, Crutcher Dunnavant wrote: > > > On 4/23/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > >> > >> I think what Ivan meant is that the normal Python rule is that if you > >> have a full-colon (ANYWHERE), and you put somethi

[Python-3000] Example implementation for string.format

2006-04-23 Thread Talin
There have been a number of interesting suggestions as to whether string.format should support pipelined conversion specifiers, nested conversion specifiers, and so forth. I'm going to follow in Guido's lead at this point, and say that perhaps these kinds of decisions should be made after looking

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Talin
Crutcher Dunnavant gmail.com> writes: > > On 4/23/06, Jay Parlar cogeco.ca> wrote: > > > > What's the use case for doing this with method and class defs? > > They're blocks, what would be the use case for having the > for/while/with/if stuff be treated different from class/def ? Besides, > it

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Jay Parlar
On Apr 23, 2006, at 6:56 PM, Crutcher Dunnavant wrote: >> > > They're blocks, what would be the use case for having the > for/while/with/if stuff be treated different from class/def ? Besides, > it comes up in platform handling code. > > if sys.platform == 'foo': class Bar: > ... > > class Foo:

Re: [Python-3000] Stackable Blocks

2006-04-23 Thread Nick Coghlan
Crutcher Dunnavant wrote: > Having been shot down so hard on my request to bring for loops into > symetry with list comprehensions, I have a new proposal - stackable > blocks. > > This is a very _small_ amount of syntax sugar, the basic idea is that > any block headers can be stacked on the same l

Re: [Python-3000] Open Issues for string.format PEP

2006-04-23 Thread Ian Bicking
Talin wrote: > Here's a condensed list of the open issues that have been raised by people > so far: > > (Well, edited somewhat - I'm including 'major' issues, not minor nits -- we > can discuss those once the major issues are settled.) > > 1) Whether to drop the optional parts of the proposal: >

Re: [Python-3000] Open Issues for string.format PEP

2006-04-23 Thread Talin
Ian Bicking colorstudy.com> writes: > > Talin wrote: > > Here's a condensed list of the open issues that have been raised by people > > so far: > > > > (Well, edited somewhat - I'm including 'major' issues, not minor nits -- we > > can discuss those once the major issues are settled.) > > > >

Re: [Python-3000] Brainstorming: Python Metaprogramming

2006-04-23 Thread Terry Reedy
"Talin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > For some reason, I have stuck in my head the idea that this concept of > 'quoting' > is central to the whole business I agree. And in Python, the main means of implicit (unwritten) quoting is to use a statement instead of a