5 ms·
In python you don't even have abstract classes, and instead you have to use horrible hacks.
by jafaku 13y ago
In python you don't even have abstract classes, and instead you have to use horrible hacks.
- RodericDay 13y agohttp://docs.python.org/2/library/abc.html http://docs.python.org/2/library/abc.html ? Even if that had flaws, PyQt carries over all the Qt abstract classes just fine.
- jafaku 13y agoI'm aware of that but that's what people call a hack, don't act like it's not. Python doesn't support abstract classes, period.
- likeclockwork 13y agoUm.. that's in the standard library. What definitions are you using for "support" and "period"?
- possibilistic 13y agoIf you're tying to develop interfaces in Python, I would argue you're using the language from the wrong standpoint. Every language has a design goal. Python doesn't care about interface contracts. The "one correct way" is the contract.
- jafaku 13y agoWith these languages it always seems like first came the language, and then its users tried really hard to make sense of it. So now apparently enforcing contracts is not important anymore. "Let's just code!" - sigh
- possibilistic 13y agoIf you want to enforce contracts, pick a language that encourages it. There are many to choose from. Plenty of people are doing just fine in Python without this. It's almost an entirely distinct problem domain. Besides, what would a contract be in a dynamically typed language? I don't think these features are bad, but they're not appropriate everywhere.
- jafaku 13y ago> If you want to enforce contracts, pick a language that encourages it. Yeah don't worry, I'm not gonna use Python. > Besides, what would a contract be in a dynamically typed language? Being dynamic has nothing to do with this. See: Clojure, PHP, etc. They have contracts. Of course things might not be appropriate everywhere. But with Python/Ruby you don't have a choice, they just lack these features.
- raverbashing 13y agoMaybe because you don't need abstract classes I'd say even that Abstract Classes are a horrible hack to the braindead inflexibility of languages like Java And 99% of the time you're doing them in Python, you're doing it wrong
- jafaku 13y agoYeah I guess you don't need OOP either then. Let's just program in Assembly.