Is it correct to use ABC in Django? For example I create a model that I want to be abstract, can I inherit ABC into it so that it becomes impossible to create instances out of it?
abstract classes exists in java but python lacks oop sophistication as it has no access modifiers for classes or class attributes or inheritance specifiers as in this case.
Excellent thank you. I was looking for that ;) It is the same as Interface in java. You don't herite from, you have to implement them. But the process is the same. Very usefull
Interesting, missed on the fact that the @property notation doesn't cause the function to work like a property in the class that implements the abstract. You actually had to implement the function, but the @property stays there. Wait there is more, they occupy the same name space as the properties themselves, but use entirely different syntax. Fascinating I wonder can I just implement them with the @property notation as they are
No, because what the super().__init__(model) line does is call the constructor of the super class, so that the iBanna's object will do everything a Phone object does upon construction. Which is why we don't have to set self.model to model like in the Phone's __init__ constructor.
I read a lot on Google about abstraction in Python. Most of it stated that the objective is to hide the information and complexity from the user. But I can'r understand and see which part exactly is the "HIDING" part. Can anyone explain this?
The user doesn't need to understand how your code works internally (meaning every line), they just need to know how to use your public classes. Those public classes are abstractions of your private classes that makes the code function.That's my interpretation. Please correct me if I'm wrong or missing something.
that moment when you google a topic and you see Indently has a video on it, you know you will understand it quick and easy... many thanks!
Bro, U shouldn't use "..." for ABC class methods, as I know for ABC U should use "pass", "..." its reserved for Protocols
Is it correct to use ABC in Django? For example I create a model that I want to be abstract, can I inherit ABC into it so that it becomes impossible to create instances out of it?
abstract classes exists in java but python lacks oop sophistication as it has no access modifiers for classes or class attributes or inheritance specifiers as in this case.
Nicely explained
Excellent thank you. I was looking for that ;) It is the same as Interface in java. You don't herite from, you have to implement them. But the process is the same. Very usefull
Hi, isn't that the 'protocol' that is somewhat like 'interface'?
@@Geza_Molnar_ yes also, .but Principles are thé same. You create an object with empty methods that need to bé filled if you want to use this object
Interesting, missed on the fact that the @property notation doesn't cause the function to work like a property in the class that implements the abstract. You actually had to implement the function, but the @property stays there.
Wait there is more, they occupy the same name space as the properties themselves, but use entirely different syntax. Fascinating
I wonder can I just implement them with the @property notation as they are
great video thank you
Why do we use Abstract class for?
to be a dick to your fellow programmers
To teach it, my dear, to teach it.
Bro get the camera I'm verified
Bro, you know I can't afford a camera.
Greatest collab in history and nobody's paying attention
Isn't iBanana.__init__ and the super() call redundant code?
No, because what the
super().__init__(model)
line does is call the constructor of the super class, so that the iBanna's object will do everything a Phone object does upon construction. Which is why we don't have to set self.model to model like in the Phone's __init__ constructor.
maybe mention that abstractproperty and abstractstaticmethod are deprecated.
what ide are you using
Thats VS Code afaik
@@deltaheiwa lol its pycharm
No it's pycharm
@@itsentdev ity pycharm ye
I read a lot on Google about abstraction in Python. Most of it stated that the objective is to hide the information and complexity from the user.
But I can'r understand and see which part exactly is the "HIDING" part. Can anyone explain this?
The user doesn't need to understand how your code works internally (meaning every line), they just need to know how to use your public classes. Those public classes are abstractions of your private classes that makes the code function.That's my interpretation. Please correct me if I'm wrong or missing something.
Hahah , ibanana like iapple
First