We need PIGs :)

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Thu Sep 6 11:51:02 CEST 2007


Stefan Arentz a écrit :
> Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr> writes:
> 
> ...
> 
>> The problem with Java is that it makes it very painfull to bridge two
>> APIs together, while Python usually makes it a breeze (easy
>> delegation, no dumb-ass psycho-rigid type system). So Java's solution
>> (hyper-formalization) isn't necessary here.
> 
> Interesting. I find Java much more predictable with APIs than Python
> actually.

I'm not going to debate on this because it's absolutely not what I'm 
talking about. My point is that Python has:

- duck typing, so you don't need one class subclassing another just to 
satisfy the compiler - as long as the object you send respects the 
expected protocol, everything's ok

- good support for delegation (via the __getattr__/__setattr__ magic 
methods), so you don't have to go thru the pain of hand-writing all the 
delegate methods - only the ones for which there's more to be done than 
straightforward delegation.


> Java has pretty strict rules for style and API design,

Java has pretty strict rules for almost anything.



More information about the Python-list mailing list