[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread Ethan Furman


Change by Ethan Furman :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread miss-islington


miss-islington  added the comment:


New changeset b502c7618d710d31517a7ee6a72890d0963e357a by Miss Islington (bot) 
in branch '3.9':
bpo-40721: add note about enum member name case (GH-22231)
https://github.com/python/cpython/commit/b502c7618d710d31517a7ee6a72890d0963e357a


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread miss-islington


miss-islington  added the comment:


New changeset 624cc10ee4aae513be9f2812f6f5621b6f32f17c by Miss Islington (bot) 
in branch '3.8':
bpo-40721: add note about enum member name case (GH-22231)
https://github.com/python/cpython/commit/624cc10ee4aae513be9f2812f6f5621b6f32f17c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 7.0 -> 8.0
pull_requests: +21303
pull_request: https://github.com/python/cpython/pull/22247

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21304
pull_request: https://github.com/python/cpython/pull/22248

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-14 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 542e1df2b018ee7068dba8076f2d6e84efd6e144 by Ethan Furman in 
branch 'master':
bpo-40721: add note about enum member name case (GH-22231)
https://github.com/python/cpython/commit/542e1df2b018ee7068dba8076f2d6e84efd6e144


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-13 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +21286
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22231

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-09-13 Thread Ethan Furman


Ethan Furman  added the comment:

For Python code at least, Guido has proclaimed:

https://mail.python.org/pipermail/python-ideas/2016-September/042340.html

I recommend naming all enums UPPER_CASE. They're constants (within a
namespace) and that's the rule for constants. It's helpful for the
reader of the code to realize what they are when passed around -- they
have a similar status to literal constants, you know they stand for a
unique value and not for some computed quantity.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-22 Thread Florian Dahlitz


Florian Dahlitz  added the comment:

Should we add a note that there is no preferred way of naming enum members and 
provide a few examples or define some naming conventions?

--
nosy: +DahlitzFlorian

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-21 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

There is no official way, you can find both in the Python tree: all caps at 
https://github.com/python/cpython/blob/master/Lib/ast.py#L615-L636 and snake 
case at https://github.com/python/cpython/blob/master/Lib/uuid.py#L76-L79.

I think it's common to use all caps for those that are used as flags (i.e. 
where each value is a power of 2 and that may be combined using bigs 
operations) but there is no one true way that you can enforced, it depends on 
the context. 

Also, note that pep8 covers the code of Python, it's not a rule that must be 
blindly applied to all Python code and that you may ignore it for various 
reasons: 
https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds.

--
nosy: +remi.lapeyre

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-21 Thread Марк Коренберг

Марк Коренберг  added the comment:

FYI: PEP8 does not mention enums.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

2020-05-21 Thread Марк Коренберг

New submission from Марк Коренберг :

Example from PEP0435:

(https://www.python.org/dev/peps/pep-0435)

>>> from enum import Enum
>>> class Color(Enum):
... red = 1
... green = 2
... blue = 3

Example from Python documentation:

(https://docs.python.org/3/library/enum.html)

>>> from enum import Enum
>>> class Color(Enum):
... RED = 1
... GREEN = 2
... BLUE = 3
...

So, what are the rules for naming enum members?
CamelCase ? snake_case ? ALL_CAPS ?

Someone should explain how should we format sources. So various linters may 
check for that.

--
assignee: docs@python
components: Documentation
messages: 369544
nosy: docs@python, socketpair
priority: normal
severity: normal
status: open
title: PEP0435 (enums) -- there is no standard on enum item letters case
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com