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

2006-04-22 Thread Bill Birch
> Guido van Rossum wrote: > If I have some utterly dynamic > code that comes up with a list of a million ints, and then I pass > that > as an argument to a function that requests the argument type is > list[int], > > you wrap it in something that checks elements for intness > as you access

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

2006-04-22 Thread Bill Birch
On Sat, 22 Apr 2006 03:12 am, Jim Jewett wrote: > On 4/20/06, Birch, Bill <[EMAIL PROTECTED]> wrote: > > Type comparison operators would only need a deep > > inspection of the types when the godel strings don't match. > > If most comparisons will be an exact match (not a subtype) > > the lookup sho

Re: [Python-3000] Limit Type Checks to Interfaces (was Type Comparisons with Godel Numbers)

2006-04-22 Thread Bill Birch
On Sat, 22 Apr 2006 06:39 pm, Guido van Rossum wrote: > > No. This is the kind of thing that would very quickly turn "optional" > typing into *mandatory* typing. One library package adds type > declarations. Now all packages that use it are required to either add > type declarations or explicit con

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

2006-04-22 Thread Bill Birch
On Sat, 22 Apr 2006 06:39 pm, Guido van Rossum wrote: ... > > No. This is the kind of thing that would very quickly turn "optional" > typing into *mandatory* typing. One library package adds type > declarations. Now all packages that use it are required to either add > type declarations or explicit

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] 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

[Python-3000] Unsure if I should write a PEP on Types

2006-04-24 Thread Bill Birch
The optional static typing blog http://www.artima.com/weblogs/viewpost.jsp?thread=87182 and many other postings imply a lot of interesting detail about types, type expression, type checking, adapt() and such. I'm considering collecting some of these subjects together in a note for review and p

Re: [Python-3000] Unsure if I should write a PEP on Types

2006-04-24 Thread Bill Birch
You wrote: >Bill> Has a PEP already been written? Would this be useful? Who else > Bill> finds this interesting or may have started on these subjects? > Bill> OK, so I'm fishing for encouragement here. ;-) > >To very loosely paraphrase the late (some would say great) Johnny Cochran: > >

[Python-3000] Metaclass syntax?

2006-05-01 Thread Bill Birch
This has probably been proposed before, here goes anyhow. instead of: class TheLarch(deciduous) __metaclass__ = KindsOfTrees could we have this syntax: class[KindsOfTrees] TheLarch(deciduous): pass more real examples: class[interface] iterable: pass class[Pers

Re: [Python-3000] Unsure if I should write a PEP on Types

2006-05-01 Thread Bill Birch
On Thu, 27 Apr 2006 01:43 pm, Guido van Rossum wrote: > Sorry for the belated response. Yes, I'd like to see this PEP. I'll > probably eventually end up rewriting it :-), but right now I'm > terribly overcommitted and really appreciate the help!!! > Rough draft is available for flames and comments

Re: [Python-3000] Metaclass syntax?

2006-05-02 Thread Bill Birch
On Tue, 2 May 2006 12:36 am, Guido van Rossum wrote: > This has usually been solved by creating a non-meta class whose only > purpose is to introduce the new metaclass. You'd write > > class TheLarch(KindsOfTrees, deciduous): ... > > and the metaclass would be called KindsOfTreesMeta. > > (Of cours

Re: [Python-3000] Types Sig Archive Broken Links?

2006-05-04 Thread Bill Birch
On Thu, 4 May 2006 05:05 pm, Birch, Bill wrote: > The Types-SIG archives link > (http://mail.python.org/pipermail/types-sig/) gives a 404 error. > > Does anyone know how to get the archive back? Had no idea that email to mailman would end up here! Anyhow, I found another copy of the archive here:

Re: [Python-3000] my take on "typeclasses"

2006-05-10 Thread Bill Birch
On Wed, 10 May 2006 08:46 am, Talin wrote: > Michael Chermside mcherm.com> writes: > > Talin writes: > > > Lets start a new top-level thread to discuss this specific > > > proposal. > > > > tomer filiba writes: > > > i'm sure my idea has flaws, but i'm very much pro-changing the type > > > system.

[Python-3000] Argument Decorators (was Re: my take on "typeclasses")

2006-05-11 Thread Bill Birch
On Thu, 11 May 2006 03:30 pm, Guido van Rossum wrote: > > Bill Janssen is proposing that the specific thing a type must do is > inherit from some abstract base class. > > Phillip Eby is countering that that isn't sufficient because he wants > to be able to make up his own categories and apply thes