₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,097 members, 8,420,326 topics. Date: Thursday, 04 June 2026 at 04:32 PM

Toggle theme

Dear Python Programmer, How Do You Implement Interfaces, Abstract Classes - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingDear Python Programmer, How Do You Implement Interfaces, Abstract Classes (496 Views)

1 Reply (Go Down)

Dear Python Programmer, How Do You Implement Interfaces, Abstract Classes by Karleb(op): 8:36am On Nov 25, 2020
I noticed python doesn't come with come with easy and clear way to implement interface and abstract class and because of this, some python articles I've read played down on the importance of these in python.


How do you as a python programmer implement these especially before python 3?

Does popular frameworks like Django and Flask have abstract classes and interfaces?
Re: Dear Python Programmer, How Do You Implement Interfaces, Abstract Classes by Taofeekdboy(m): 5:38pm On Nov 25, 2020
Karleb:
I noticed python doesn't come with come with easy and clear way to implement interface and abstract class and because of this, some python articles I've read played down on the importance of these in python.


How do you as a python programmer implement these especially before python 3?

Does popular frameworks like Django and Flask have abstract classes and interfaces?
In Python Class, We have Encapsulation, Polymorphization, Abstraction and Inheritance.
Each of the above terms has its own function and you can implement abstraction especially in Django, cos all you need to write inside the class is abstraction = True.
Re: Dear Python Programmer, How Do You Implement Interfaces, Abstract Classes by Petchu(m): 1:21pm On Nov 26, 2020
#Abstract classes:

from abc import ABCMeta, abstractmethod
class Petchu(metaclass = ABCMeta):
@abstractmethod
def petchu(pself):
pass

#so this would return an exception:
peter = Petchu ()
Re: Dear Python Programmer, How Do You Implement Interfaces, Abstract Classes by Petchu(m): 1:23pm On Nov 26, 2020
Interfaces could be implemented a number of ways probably by augmented class methods
1 Reply

As A Programmer, How Are You Coping In This Economy?As A Programmer How Do You Learn/understand A New LanguageI Want My Son To Be A Programmer, How Do I Go About It234

���� programmingList Of Tech Firms In Lagos Or Anywhere In NigeriaWhy You Are Failing To Learn Programming!