Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Expression 'x' in Enumeration fails on python3 with KeyError. #765

Closed
wants to merge 1 commit into from

Conversation

asenchenko
Copy link

To solve this problem, explicit contains method is added.

To solve this problem, explicit __contains__ method is added.
@asenchenko asenchenko changed the title Expression 'x' in Enumeration failes on python3 with KeyError. Expression 'x' in Enumeration fails on python3 with KeyError. Jun 28, 2018
@cpascual
Copy link
Member

cpascual commented Jun 28, 2018

Hi @asenchenko , I am surprised by this PR since Taurus does not support python 3 yet (see #680 ), although some effort has been started (see #703)
So, I wonder... are you using it (or some part of it) under python3 ?
If so, could you give some details?
Also, you probably could join the conversation in #703 and contribute there (help is needed!)

Apart from that, since your commit is about taurus.core.util.enumeration.Enumeration, I think you should also be aware of SEP12. While this is not officially implemented (we haven't implemented the backwards compatibility layer), in practice we try to follow it for new developments (i.e., we try to base all new enumerations on the Enum module rather than on taurus.core.util.enumeration.Enumeration)

Having said all that, I've revised your proposed changes and they all seem ok to me, so IMHO we can merge it, but before, could you please provide some code snippet demonstrating the intended feature/bugfix that it provides?

@asenchenko
Copy link
Author

Hi @cpascual. I'm sorry for the confusion. I know that Taurus does not support python3.
I'm porting Taurus to python3 and this bug appeared during this work.
It fixes problem with enums in #703.

@cpascual
Copy link
Member

I'm porting Taurus to python3 and this bug appeared during this work. It fixes problem with enums in #703.

Ok, then I wonder if it wouldn't make more sense to make a PR against the branch of #703 ? (just to centralise the python3-related effort and avoid merge conflicts due to parallel implementations).

However, for that we need to know if @piertoni is still interested in this... I'll ask in #703

@cpascual
Copy link
Member

Hi, I merged these changes into the branch for #703, and therefore I am closing this PR to centralise the discussion on #703 and #680

@cpascual cpascual closed this Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants