Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Talin
Collin Winter wrote: > On 8/15/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >> Personally, I thought Guido's original proposal for function annotations, >> which included a __typecheck__ operator that was replaceable on a >> per-module basis (and defaulted to a no-op), was the perfect thing -- >>

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Greg Ewing
Guido van Rossum wrote: > Collin wrote a great PEP that doesn't commit to any kind of semantics > for annotations. I think the argument started because Collin's PEP actually went further than that, and asserted that there wouldn't be any problems created by this lack of specification, for reasons

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Greg Ewing
Guido van Rossum wrote: > And how would that reduce the clutter? The information still has to be > entered by the user, presumably with the same disambiguating tags, and > some punctuation. But at least the function header itself would retain its wysiwyt[1] character of being mostly just a list o

Re: [Python-3000] Fwd: Conventions for annotation consumers (was: Re: Draft pre-PEP: function annotations)

2006-08-16 Thread Paul Prescod
Okay, you're the boss. The conversation did go pretty far afield but the main thing I wanted was just that if a user wanted to have annotations from framework 1 and framework 2 they could reliably express that asdef foo(a: [Anno1, Anno2]): All that that requires is a statement in the spec saying: "

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Guido van Rossum
On 8/16/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Guido van Rossum" <[EMAIL PROTECTED]> wrote: > > On 8/16/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > @docstring > > > @typechecker > > > @constrain_values > > > @__signature__([doc("frobination count"), > > > type(Nu

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > On 8/16/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > @docstring > > @typechecker > > @constrain_values > > @__signature__([doc("frobination count"), > > type(Number), > > constrain_values(range(3,9))], > >

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Guido van Rossum
On 8/16/06, Collin Winter <[EMAIL PROTECTED]> wrote: > Sorry, I meant "restrict" as in having it stated that the annotations > are for typechecking, rather than attempting to support a dozen > different uses simultaneously. The annotations would still be > free-form, with the semantics up to whoeve

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Guido van Rossum
On 8/16/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Guido van Rossum" <[EMAIL PROTECTED]> wrote: > > On 8/16/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > > > That is one reason I wonder whether all annotations/modifications have > > > to actually be part of the prologue, or whether they could

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Jim Jewett
On 8/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 8/16/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > > I hope that needing more than one line per argument will be unusual, > > but needing more than one line for a definition may not be. > I expect the latter will be too, as it would only

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > On 8/16/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > > That is one reason I wonder whether all annotations/modifications have > > to actually be part of the prologue, or whether they could be applied > > to the Signature afterwards. > > And how would

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Paul Prescod
I said "lists and tuples" where I meant "lists and strings".On 8/16/06, Paul Prescod <[EMAIL PROTECTED] > wrote:On 8/16/06, Collin Winter <[EMAIL PROTECTED]> wrote: Sorry, I meant "restrict" as in having it stated that the annotationsare for typechecking, rather than attempting to support a dozen

Re: [Python-3000] Fwd: Conventions for annotation consumers (was: Re: Draft pre-PEP: function annotations)

2006-08-16 Thread Guido van Rossum
There's much in this thread that I haven't followed, for lack of time. But it seems clear to me that you've wandered off the path now that you're discussing what should go into the annotations and how to make it so that multiple frameworks can coexist. I don't see how any of that can be analyzed

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Paul Prescod
On 8/16/06, Collin Winter <[EMAIL PROTECTED]> wrote: Sorry, I meant "restrict" as in having it stated that the annotationsare for typechecking, rather than attempting to support a dozendifferent uses simultaneously. The annotations would still befree-form, with the semantics up to whoever's impleme

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Phillip J. Eby
At 11:41 AM 8/16/2006 -0500, Collin Winter wrote: >On 8/16/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >>At 10:09 AM 8/16/2006 -0500, Collin Winter wrote: >> >On 8/15/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >> >>Personally, I thought Guido's original proposal for function annotations, >> >>

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Collin Winter
On 8/16/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 10:09 AM 8/16/2006 -0500, Collin Winter wrote: > >On 8/15/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > >>Personally, I thought Guido's original proposal for function annotations, > >>which included a __typecheck__ operator that was repla

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Paul Prescod
On 8/16/06, Collin Winter <[EMAIL PROTECTED]> wrote: I'd be perfectly happy to go back to talking about "type annotations",rather than the more general "function annotations", especially sincemost of the discussion thus far has been about how to multiple things with annotations at the same time. Re

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Phillip J. Eby
At 10:09 AM 8/16/2006 -0500, Collin Winter wrote: >On 8/15/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: >>Personally, I thought Guido's original proposal for function annotations, >>which included a __typecheck__ operator that was replaceable on a >>per-module basis (and defaulted to a no-op), was

Re: [Python-3000] Bound and unbound methods

2006-08-16 Thread Guido van Rossum
On 8/15/06, Calvin Spealman <[EMAIL PROTECTED]> wrote: > On 8/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Right. I'm against anything that changes the current semantics. I'm > > all for a compiler optimization that turns " . ( > > )" into a single opcode that somehow manages to avoid c

Re: [Python-3000] Conventions for annotation consumers

2006-08-16 Thread Guido van Rossum
On 8/15/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > But, in general, performing this disambiguation requires > executing the module that is making the annotations. For > a processor that only wants to deal with the source, this > is undesirable. Um, when did we start off in the direction of source

Re: [Python-3000] Fwd: Conventions for annotation consumers

2006-08-16 Thread Collin Winter
On 8/15/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > Personally, I thought Guido's original proposal for function annotations, > which included a __typecheck__ operator that was replaceable on a > per-module basis (and defaulted to a no-op), was the perfect thing -- > neither too much semantics

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Guido van Rossum
On 8/16/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > Yes and no; I don't think it will be that uncommon to have multiple > annotations, somewhat similar to "public static final int". Also note > that needing to disambiguate the annotations will tend to increase > their length. God save us from pub

Re: [Python-3000] Function annotations considered obfuscatory (Re: Conventions for annotation consumers)

2006-08-16 Thread Jim Jewett
On 8/16/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 8/15/06, Greg Ewing <[EMAIL PROTECTED]> wrote: [9 lines for a two argument def] > > There's another thing that's bothering me about all this. > > The main reason Guido rejected the originally suggested > > syntax for function decora