Steven D'Aprano wrote:

> This is an example of overloading:
> 
> class Cheese(object):
>     def flavour(self):
>         return "tasty and scrumptious"
>     def colour(self):
>         return "yellow"
> 
> Now we define a sub-class which overloads some methods:
> 
> class BlueVein(Cheese):
>     def colour(self):
>         return "white with blue veins"

Nope - while the term "overloading" is definitely overloaded, the above
is not an example of any use of "overloading".

It is an example of "overriding".

The most common use of "overloading" refers to having multiple methods
on a class with the same name, but different signatures.

Tim Delaney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to