Skip to content

Conversation

@l0rda
Copy link

@l0rda l0rda commented Apr 27, 2014

There is a difference with dict.keys() in Python 2 & 3 versions. So if we use python 2.x, activation will never work. This commit will fix problem.

Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> x = {'aaa':1,'bbb':2}
>>> x.keys()
['aaa', 'bbb']
>>> x.keys() == {'aaa','bbb'}
False
>>> x.keys() == ['aaa','bbb']
True
>>> list(x.keys()) == ['bbb', 'aaa']
True

Python 3.4.0 (default, Mar 25 2014, 11:07:05)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> x = {'aaa':1,'bbb':2}
>>> x.keys()
dict_keys(['bbb', 'aaa'])
>>> x.keys() == ['bbb', 'aaa']
False
>>> list(x.keys()) == ['bbb', 'aaa']
True

There is a difference with dict.keys() in Python 2 & 3 versions. So if we use python 2.x, activation will never work. This commit will fix problem.

Python 2.7.5 (default, Aug 25 2013, 00:04:04) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = {'aaa':1,'bbb':2}
>>> x.keys()
['aaa', 'bbb']
>>> x.keys() == {'aaa','bbb'}
False
>>> x.keys() == ['aaa','bbb']
True
>>> list(x.keys()) == ['bbb', 'aaa']
True

Python 3.4.0 (default, Mar 25 2014, 11:07:05) 
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = {'aaa':1,'bbb':2}
>>> x.keys()
dict_keys(['bbb', 'aaa'])
>>> x.keys() == ['bbb', 'aaa']
False
>>> list(x.keys()) == ['bbb', 'aaa']
True
@lig
Copy link
Owner

lig commented Apr 28, 2014

There is no Python 2.x support yet. I will stash this for future investigation in the Python 2.x branch.

@lig lig added py2 labels Apr 28, 2014
@lig lig added this to the v0.3 milestone Apr 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants