[Python-ideas] Naming convention for Enums

Bar Harel bzvi7919 at gmail.com
Wed Sep 14 07:20:02 EDT 2016


Hey guys,

This is something that has been discussed before several times, whether in
Python mailing list and whether in stackoverflow, each providing different
answers.

I believe that we should add a naming convention in pep8 to solve this
issue.

Enums in Python are a unique creature - it's a class, the members aren't
injected into module level, it can have methods, but it's attributes are
somewhat consts (although they can be modified via __new__).

The fact that currently every person names them differently defies the
whole purpose of a convention document.

Although I'm in favor of lower-case instead of upper-case, I believe that
we need to make a decision as no decision is somewhat worse and causes a
lot of confusion.

I'm not entirely sure how pep-8 was built (was it a poll? was it a BDFL
announcement? was it discovered in a fortune cookie just like pep 285?),
regardless how it built I believe we should make that addition for a
clearer future :-)

Any thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160914/47aa9349/attachment.html>


More information about the Python-ideas mailing list