Guido van Rossum <guido@python.org> writes: > Is this still relevant to Python? Why are C++ member functions > difficult to generic programs? Does the same apply to Python methods? In a generic algorithm foo, you can write def foo1(x): bar(x) if you have global functions. With methods, you need to write def foo1(x): x.bar() which means that bar must be a method of x. This might be difficult to achieve if x is of a class that you cannot control. In C++, it is then still possible to define a function def bar(x of-type-X): pass which, by means of overload resolution, will be found from foo1 automatically. In Python, this is not so easy since you don't have overloading. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4