Re: [Python-3000] why interfaces shouldn't be trusted

2006-05-11 Thread Nick Coghlan
Marcin 'Qrczak' Kowalczyk wrote: > "tomer filiba" <[EMAIL PROTECTED]> writes: > >> one thing that worries me with generic methods is, they would >> dispatch based on types... which means my proxies would all break. >> please, think of the proxies! ;) > > OTOH proxies generated by my Python<->Kogu

Re: [Python-3000] why interfaces shouldn't be trusted

2006-05-10 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You seem to be still under the influence of the type-safety mafia, who > want to make you believe that with enough type-checking you can > prevent all bugs (though they don't believe it themselves). > > Python alread

Re: [Python-3000] why interfaces shouldn't be trusted

2006-05-10 Thread Guido van Rossum
On 5/10/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i think it's only Bill who said that, but i wanted to show why interfaces > (and inheritance) shouldn't be the basis for type-checking. > > here's a nice interface: > > class IFile(object): > def write(self, data): > pass > def r

Re: [Python-3000] why interfaces shouldn't be trusted

2006-05-10 Thread Marcin 'Qrczak' Kowalczyk
"tomer filiba" <[EMAIL PROTECTED]> writes: > one thing that worries me with generic methods is, they would > dispatch based on types... which means my proxies would all break. > please, think of the proxies! ;) OTOH proxies generated by my Python<->Kogut bridge would break if hasattr was used to

[Python-3000] why interfaces shouldn't be trusted

2006-05-10 Thread tomer filiba
i think it's only Bill who said that, but i wanted to show why interfaces (and inheritance) shouldn't be the basis for type-checking. here's a nice interface: class IFile(object): def write(self, data): pass def read(self, count): pass and here's a class that "implements/