On Jan 29, 2010, at 10:15 AM, Danilo Freitas wrote:
> 2010/1/29 Christian <[email protected]>:
>> Hi,
>> pretty good overview.
>>
>> But as implied in the comment of polymorphism the example doesn't
>> demonstrate polymorphism. Maybe you should add some lines like:
>
> Yes, it does. That is an example of 'inclusion polymorphism'.
>
>> cdef A *c = new B()
>>
>> That would be polymorphism, or not?
>
> Don't know exactly if this is polymorphism. This is an example of a
> cast (upcast, downcast...). But it works. I'll update the wiki with
> this example.
Polymorphism is (loosely) about letting
cdef A *a = new B()
a.do_stuff()
behave differently than
cdef A *a = new A()
a.do_stuff()
- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev