[issue40042] Enum Flag: psuedo-members have None for name attribute

2021-02-01 Thread Ethan Furman


Ethan Furman  added the comment:

This issue is fixed in #38250.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
superseder:  -> enum.Flag should be more set-like

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-09-26 Thread Irit Katriel


Irit Katriel  added the comment:

I see in the code of _create_pseudo_member_ that _name_ is deliberately set to 
None, and furthermore in __str__ and __repr__ the fact that it is None is used 
to determine whether self is a composite (pseudo) or not.

So first question is whether this should be fixed.

If so, I see two options:

1. Establish another way to determine whether self is a composite or not, and 
change they way _name_ is initialised.

2. Leave _name_ as is, but override name (which currently is defined in Enum 
and simply returns _name_ but can be redefined to do something else).

--

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-09-23 Thread Irit Katriel


Irit Katriel  added the comment:

I believe this is what Rahul means:

import enum
class Color(enum.Flag):
RED = enum.auto()
BLUE = enum.auto()
GREEN = enum.auto()

white = Color.RED | Color.BLUE | Color.GREEN
assert white.name is None

#  Note, however that:
assert str(Color.RED | Color.BLUE | Color.GREEN) == "Color.GREEN|BLUE|RED"

--
nosy: +iritkatriel

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-05-18 Thread Rahul Kumaresan


Change by Rahul Kumaresan :


--
nosy: +rahul-kumi

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-05-18 Thread Felipe Rodrigues


New submission from Felipe Rodrigues :

Hi,

Can you elaborate on this?

Thanks!

--
nosy: +fbidu

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-03-22 Thread Ethan Furman


Change by Ethan Furman :


--
type:  -> enhancement

___
Python tracker 

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



[issue40042] Enum Flag: psuedo-members have None for name attribute

2020-03-22 Thread Ethan Furman


Change by Ethan Furman :


--
assignee: ethan.furman
nosy: ethan.furman
priority: normal
severity: normal
stage: needs patch
status: open
title: Enum Flag: psuedo-members have None for name attribute
versions: Python 3.9

___
Python tracker 

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