Re: [Python-3000] duck typing

2006-11-15 Thread Andrew Koenig
> Static != non-duck. > One could imagine static duck typing (is it the same as structural > typing?) with type inference. I wonder if some existing languages have > static duck typing (boo? haskell?). C++ (using templates). ___ Python-3000 mailing lis

Re: [Python-3000] duck typing

2006-11-15 Thread Antoine
> Non-duck typing is a seriously bad idea, forced > on some other languages by static typing. Static != non-duck. One could imagine static duck typing (is it the same as structural typing?) with type inference. I wonder if some existing languages have static duck typing (boo? haskell?). __

Re: [Python-3000] duck typing

2006-05-08 Thread Michael Chermside
Bill Janssen writes: > I don't want to ever again use a library that claims to export a > "dict" object, only to find (later) that the implementor hasn't > implemented some of the methods of the real "dict" type because he > thought they wouldn't be called. And there is the crux of the matter. I *

Re: [Python-3000] duck typing

2006-05-07 Thread Greg Ewing
Bill Janssen wrote: > I think that there is little of advantage in the Java type system to > be adopted into Python. One possible addition is the often-discussed > optional type declarations and associated ability to define an > interface for a module or class. The problem with something like th

Re: [Python-3000] duck typing

2006-05-07 Thread Bill Janssen
> A language with the same type system > as Java, but enforced at run time instead of compile > time, would be just as annoying to use. Python already has a different, and in many respects better, type system than Java has. I'm simply suggesting that the common practice of ignoring -- or worse, s

Re: [Python-3000] duck typing

2006-05-07 Thread Marcin 'Qrczak' Kowalczyk
Alex Martelli <[EMAIL PROTECTED]> writes: > Java's typechecking IS enforced at runtime just about each and every > time you cast something (I'm told the need for casting has diminished > with Java 1.5's generics, but I have no experience of 1.5; earlier, > casts abounded each time you used c

Re: [Python-3000] duck typing

2006-05-07 Thread Alex Martelli
On May 6, 2006, at 6:37 PM, Greg Ewing wrote: ... > The disadvantages associated with very strong type systems > arise because of their strength, not whether they are > static or dynamic. A language with the same type system > as Java, but enforced at run time instead of compile > time, would

Re: [Python-3000] duck typing

2006-05-06 Thread Greg Ewing
Bill Janssen wrote: > Thanks, Antoine, but I don't want strong static typing at all. I > wouldn't mind optional partial static typing, but what I want is > strong *dynamic* typing How strong do you want it, exactly? The disadvantages associated with very strong type systems arise because of the

Re: [Python-3000] duck typing

2006-05-06 Thread Bill Janssen
> If you want a Python-lookalike with strong static typing (and optional > duck typing with the "duck" keyword!), then try Boo: > http://boo.codehaus.org/Home Thanks, Antoine, but I don't want strong static typing at all. I wouldn't mind optional partial static typing, but what I want is strong *

Re: [Python-3000] duck typing

2006-05-06 Thread Antoine Pitrou
Le samedi 06 mai 2006 à 08:05 -0400, Blake Winton a écrit : > Bill Janssen wrote: > > GvR writes: > >>On 5/5/06, Bill Janssen <[EMAIL PROTECTED]> wrote: > >Is there anywhere else in Python where the type of an object isn't > >checkable with isinstance()? > Yes, it's called duck typing.