Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python naming conventions for interfaces and abstract classes?

What is the convention for naming interfaces and abstract classes in Python? PEP 8 doesn't discuss this. For example, in Java, interfaces are often named with an I prefix. In PHP (prior to namespaces), abstract classes are typically named with an _Abstract suffix.

(I realize that Pythonists are not keen on interfaces, and perhaps this is the reason why I can't find much consensus on this topic. But the usage of interfaces and abstract classes is not my question.)

like image 771
Mark E. Haase Avatar asked May 23 '12 16:05

Mark E. Haase


1 Answers

I'm not aware of any community-wide standards in that regard apart from PEP8, which doesn't address this specifically.

I'd suggest to do whatever your team is most comfortable with, but above all else be consistent.

like image 58
Daenyth Avatar answered Sep 18 '22 14:09

Daenyth