On Thu, 9 Jun 2016 9:48 PM Rudi Hammad <[email protected]> wrote:

>
>
> El jueves, 9 de junio de 2016, 10:41:00 (UTC+2), Marcus Ottosson escribió:
>>
>> def makeIk(self):
>>     self.makeIk()
>>
>> Try it
>>
>
> it gives an error. So that´s why there is super(). it allows to have the
> same method in a subclass, and use that same method existing in the
> superclass. right?
> isn´t that technically an extension, because you are using the same method
> from the superclass and add more functionality?
> In this case isn´t the same talking about overriding and talking about
> extension?
>

I haven't heard the term "extension method" used before in the context of
Python, so I had to look it up

https://en.wikipedia.org/wiki/Extension_method

The definition doesn't seem to apply to how you are using it to describe
this python code. Its defined as adding a method to a class after its type
spec has already been defined (or compiled). So in python the closest thing
would be to monkey patch an existing class by adding a new method to it
(not to an instance but to the actual class, so that any instance will gain
access).

When you redefine an existing method from a super class in the derived
class, that would be called "overriding" in Python. You are making an
existing method do something different than the super class implementation.
Whether you choose to also call the the super class implementation at any
point in that new overload is up to you.

-- 
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/0b3b06f8-945d-42f3-b999-72ae18fd2edd%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/0b3b06f8-945d-42f3-b999-72ae18fd2edd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3%3DuHrfMmqn_WWfwicaMg8kaHemAMPRJOo_PVDA7hBcxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to