yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #55083
[Bug 1613409] [NEW] Sentinel doesn't work with copy()
Public bug reported:
The Sentinel object in neutron_lib.constants doesn't return the sentinel
object when used with copy.copy(), but it does with copy.deepcopy().
This behavior is inconsistent as deepcopy keeps the singleton behavior,
but copy doesn't.
For example:
---
import copy
from neutron_lib.constants import Sentinel
singleton = Sentinel()
print(copy.deepcopy(singleton) == copy.copy(singleton))
---
Outputs 'False'.
[1] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/constants.py#L255
** Affects: neutron
Importance: Undecided
Assignee: Boden R (boden)
Status: New
** Tags: lib
** Changed in: neutron
Assignee: (unassigned) => Boden R (boden)
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1613409
Title:
Sentinel doesn't work with copy()
Status in neutron:
New
Bug description:
The Sentinel object in neutron_lib.constants doesn't return the
sentinel object when used with copy.copy(), but it does with
copy.deepcopy().
This behavior is inconsistent as deepcopy keeps the singleton
behavior, but copy doesn't.
For example:
---
import copy
from neutron_lib.constants import Sentinel
singleton = Sentinel()
print(copy.deepcopy(singleton) == copy.copy(singleton))
---
Outputs 'False'.
[1] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/constants.py#L255
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1613409/+subscriptions
Follow ups