[Python-il] problem in script
Shlomi Fish
shlomif at iglu.org.il
Mon Dec 28 12:39:17 IST 2009
On Sunday 27 Dec 2009 18:43:27 Shai Berger wrote:
> > On Sunday 27 Dec 2009 16:53:10 Yitzhak Wiener wrote:
> > > BTW what is the best user documentation for Python? And do you know if
> > > there is good Hebrew documentation?
>
> First of all, what Shlomi said.
>
> I ran into a Hebrew book about Object Oriented Programming (can't remember
> the name), which boasted "examples in Python". So I looked. One example
> given there explained how one should overload a method (that is, provide
> different definitions with different arguments, where the compiler is
> supposed to pick the right definition for every call according to
> arguments provided). Python does not have overloading.
Python indeed does not have such overloading like C++ does, but on the other
hand you can emulate such behaviour using multimethods:
http://en.wikipedia.org/wiki/Multiple_dispatch#Python
And the big advantage of Multi-methods is that the multiple dispatch happens
at *run-time* instead of in C++'s compile time so it is more flexible.
For more about the motivation for multimethods I can recommend the "Practical
Common Lisp" video:
http://video.google.com/videoplay?docid=448441135356213813#
The video was very insightful and instructive but the corresponding book (also
available online - at http://www.gigamonkeys.com/book/ ) kinda delves on many
details and as a result one cannot see the forest for the trees. It kinda
convinced me that Common Lisp was not very practical. :-).
Regards,
Shlomi Fish
> I remember the
> second example I checked also had a severe error, but not what it was.
>
> That's the only Hebrew book "about" Python I've ever seen.
>
> Shai.
> _______________________________________________
> Python-il mailing list
> Python-il at hamakor.org.il
> http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il
>
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
http://www.shlomifish.org/humour/ways_to_do_it.html
Bzr is slower than Subversion in combination with Sourceforge.
( By: http://dazjorz.com/ )
More information about the Python-il
mailing list