A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024729.html below:

[Python-Dev] deprecating string module?

[Python-Dev] deprecating string module? [Python-Dev] deprecating string module?Martin v. Loewis martin@v.loewis.de
31 May 2002 00:49:30 +0200
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