2 ms·
Python is not really object oriented. To get information hiding you have to wrap your class in a closure and that closure has to track the individual instances
by Beltiras 10y ago
Python is not really object oriented. To get information hiding you have to wrap your class in a closure and that closure has to track the individual instances. It's not clean code and it's horribly inefficient.
Python is also not a functional language.
Python provides language structures that allow you to use both styles of programming OOP and functional as-if-it-was.
- greenshackle2 10y agoRight, it's not pure OOP. It's "only" missing strong encapsulation. Trying to implement really private properties in Python doesn't work too well, the language isn't designed for it and it's not considered 'Pythonic'. All I meant is that everything is an object. It doesn't have strong encapsulation, but you can't get away from its weak encapsulation, since the basic types are objects.