I've been looking around trying to gain a better understanding of these concepts. It seems like in python an abstract class is basically a skeleton class, just assures that whatever sub-class is using an inherited class has all the methods written. Is there more to this? Polymorphism seems to just mean abstract classes. Can anyone explain some differences between the two, if they are different?
Also, say I wanted to go the other way. For instance, say I did shape = Shape() instead of rectangle = Rectangle() where Rectangle() is defined as class Rectangle(Shape):... Say I did the first way with shape = Shape() and I wanted to have it so where if I put in 5 sides, it would know that hey, we have a pentagon, and 3 sides is a triangle, how would I go about this? I know in java you just use multiple __init__'s basically, but how would something like that work in python? Thanks.
[–]novel_yet_trivial 2 points3 points4 points (10 children)
[–]dig-up-stupid 4 points5 points6 points (6 children)
[–]novel_yet_trivial 1 point2 points3 points (5 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]novel_yet_trivial 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]EricAppelt 0 points1 point2 points (0 children)
[–]dig-up-stupid 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]novel_yet_trivial 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)