Python Forum
Polymorphism in Python Question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Polymorphism in Python Question
#7
(Dec-13-2017, 04:06 PM)hshivaraj Wrote:
Quote:IOW, from your example, I don't see how to have a variable based on Animal that is an instance of Dog.
Python is dynamically typed language and therefore the concept of dynamic binding is not relevant. The point of using an abstract class is to enforce the subclass to implement certain methods in the deriving class. And also you cant instigate an object of type class which has an abstract method.

Gotcha. This is one area where Python is much different (not in a bad way) than Java.

Appreciate your reply.
Reply


Messages In This Thread
Polymorphism in Python Question - by Oliver - Dec-13-2017, 02:10 PM
RE: Polymorphism in Python Question - by mpd - Dec-13-2017, 02:20 PM
RE: Polymorphism in Python Question - by hshivaraj - Dec-13-2017, 02:37 PM
RE: Polymorphism in Python Question - by Oliver - Dec-13-2017, 03:36 PM
RE: Polymorphism in Python Question - by hshivaraj - Dec-13-2017, 04:06 PM
RE: Polymorphism in Python Question - by Oliver - Dec-13-2017, 08:26 PM
RE: Polymorphism in Python Question - by metulburr - Dec-13-2017, 04:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Polymorphism not working with a call to a abstract method colt 3 2,349 Nov-04-2019, 11:04 PM
Last Post: colt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020